Also when I refresh in the log I see something called “ThermostatModeDirector” so seems like more shenanigans on the server side are happening
The code for the failing tile is this
valueTile(“temperature”, “device.temperature”) {
state(“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”]
]
)
}
The code for the tile that works is this but I create the temp reading before I push the value and it seems the tile is converting my 78 to Celsius 172.
// Extra Temperature Tile with Name for Home Screen
valueTile("temperatureName", "device.temperatureName", inactiveLabel: false, decoration: "flat") {
state "temperatureName", label:'${currentValue}', unit:""
}
The code pushing the values is here.
// - Sensor Multilevel Report
// The device is reporting temperature readings
def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv3.SensorMultilevelReport cmd)
{
log.debug "SensorMultilevelReport reporting...cmd=$cmd"
// Determine the temperature the device is reporting
def map = [:]
switch (cmd.sensorType) {
case 1:
// temperature
def cmdScale = cmd.scale == 1 ? "F" : "C"
// converTemp returns string with two decimal places
// convert to double then to int to drop the decimal
Integer temp = (int) convertTemperatureIfNeeded(cmd.scaledSensorValue, cmdScale).toDouble()
map.value = temp
map.unit = getTemperatureScale()
map.name = "temperature"
// Send event to set ShortName + Temp tile
def shortNameVal = shortName == null ? "ZXT-120" : shortName
def tempName = shortNameVal + " " + map.value + "°"
log.debug "Sensor Reporting temperatureName $tempName"
sendEvent("name":"temperatureName", "value":tempName)
sendEvent("name":"temperature", "value":map.value, "isStateChange":true, unit:cmdScale, displayed:true)
break;
default:
log.warn "Unknown sensorType reading from device"
break;
}
}
I don’t understand. Neither tile uses css, and the working tile is completely raw it’s just a value tile that used to work. The other tile is a text tile and I compute the correct temp and configure set the text to "Name " + myComputed Temp. That works fine.
So I think somehow they broke the processing for Value Tiles to be Celsius/Fahrenheit smart. Actually my code is pushing converted degrees so perhaps the opposite is true they added the C/F intelligence and didn’t bother telling us.
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
5
The OP’s Topic is non-SmartTiles related, but, sure, it could be symptomatic of the same underlying SmartThings “platform issue” that has sporadically affected some of our users that use Custom CSS.
I altered my code to not call “convertTempIfNeeded” and it now displays incorrectly when you update but corrects itself when you reload the tiles by leaving and returning.
So basically whatever they broke can’t be fixed because I need to send converted temp to get it correct it the page is already displayed and I need to send the unconverted temp to get it to display correctly when the tile is loaded with the entire page.
Sorry for any confusion. I know this thread is not about smarttiles. My point was just that all of a sudden today both smarttiles users and some custom DTH users were reporting that they had changed nothing but the tiles are broken. So that sounded to me like a possible related platform issue. Maybe it’s two completely unrelated problems that just happened to occur at the same time.
@slagle I found the bug. I am not guessing that what really happened is the valueTile was fixed to handle C/F temps correctly. I was passing a temp in fahrenheit with a unit of Celsius. This has worked for over a year but now stopped working. But the bug was always in my code.
sendEvent(“name”:“temperature”, “value”:map.value, “isStateChange”:true, unit:cmdScale, displayed:true)
Since map.value was converted to Fahrenheit I needed to hard code the unit to the same. So correct code is.
sendEvent(“name”:“temperature”, “value”:map.value, “isStateChange”:true, unit:1, displayed:true)