@GSzabados - thanks for this. I’m trying to figure out how to report decimal temp values from my newly bought ST Multisensors. I grabbed the latest code from Github and it’s no obvious where the code converts the value to an integer.
I found your suggested code in this thread. So my temperature section looks like this:
} else if (maps[0].name == "temperature") {
def map = maps[0]
def decimalValue = Double.parseDouble(description.split(": ")[1])
map.value = (float) Math.round( (decimalValue as Float) * 10.0 ) / 10
if (tempOffset) {
map.value = (float) map.value + (float) tempOffset
}
map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'
map.translatable = true
}
I also changed "runlocally to “false”.
definition(name: “SmartSense Multi Sensor 2”, namespace: “smartthings”, author: “SmartThings”, runLocally: false, minHubCoreVersion: ‘000.017.0012’, executeCommandsLocally: false, mnmn: “SmartThings”, vid: “generic-contact-2”) {
It doesn’t appear to change anything in either the old or new ST app. I noticed that the tile code near the top only appears to affect the “Classic app” as I bumped temperature so that it shows on the Classic dashboard however this doesn’t work for the new app dashboard. Strange that the two apps wouldn’t leverage the same code.
I’m clearly doing something wrong as it worked for @Jon_ST. Thoughts?