Hi there, this is my first post.
I logged into the IDE and created a custom device handler, and installed it.
I need to increase the reported temperature on one of the sensors by +8 degrees.
I tried coding in groovy, but its very new to me.
I am trying to change the label:’${currentValue}’, for the temperature tile to reflect +8 degrees
I tried to do label:’${currentValue}’+8, But then I got 76.8F+8, instead of 84.6
I attached the code that I have working so far
tiles(scale: 2) {
multiAttributeTile(name:"temperature", type: "generic", width: 6, height: 4){
tileAttribute ("device.temperature", key: "PRIMARY_CONTROL") {
attributeState "temperature", label:'${currentValue}',
backgroundColors:[
[value: 31, color: "#153591"],
[value: 44, color: "#1e9cbb"],
[value: 59, color: "#90d2a7"],
[value: 74, color: "#44b621"],
[value: 84, color: "#f1d801"],
[value: 95, color: "#d04e00"],
[value: 96, color: "#bc2323"]
]
}
}
valueTile("humidity", "device.humidity", width: 2, height: 2) {
state "humidity", label:'${currentValue}% humidity', unit:""
}
valueTile("illuminance", "device.illuminance", width: 2, height: 2) {
state "illuminance", label:'${currentValue} lux', unit:""
}
// valueTile(“battery”, “device.battery”, inactiveLabel: false, decoration: “flat”, width: 2, height: 2) {
// state “battery”, label:’${currentValue}% battery’, unit:""
// }
valueTile("batteryStatus", "device.batteryStatus", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "batteryStatus", label:'${currentValue}', unit:""
}
valueTile("powerSupply", "device.powerSupply", height: 2, width: 2, decoration: "flat") {
state "powerSupply", label:'${currentValue} powered', backgroundColor:"#ffffff"
}
main(["temperature", "humidity", "illuminance"])
details(["temperature", "humidity", "illuminance", "batteryStatus"])
}
}
Any ideas is helpful. English not so good, am new.