Decimal Places on a valueTile


(Steve Herrell) #1

Is it possible to show decimal places on a valueTile? My thermostat is running in Centigrade and it’s possible to change the temperature in .5 degree increments. Using the follow code the tile shows 21 as 21, 21.5 as 21 and 22 as 22.

valueTile("coolingSetpoint", "device.coolingSetpoint", inactiveLabel: false, decoration: "flat") {
    state "cool", label:'${currentValue}° cool', unit:"C", backgroundColor:"#ffffff"
}

Many thanks,

Steve


Honeywell Smart Wi-Fi Thermostat Compatibility
(Barry) #2

See my Aeon HEM v2 Smart Device for one way to accomplish this: https://github.com/SANdood/Aeon-HEM-v2

You basically have to send strings that can’t be (silently) translated into Integers by the Physical Graph foundation…


(Steve Herrell) #3

Thank you, that’s exactly what I needed to do!


(Barry) #4

For others, the trick is often to pre-format the text string you want to display in the tile down in the code that is handling the event. In some cases, you may need TWO sendEvents: for example, one to send the Temperature as an integer so that the corresponding Attribute is updated by the framework, and a second one to send the TemperatureDisplay value which you show in your tile. If you’re doing the latter, you likely need to also do the former so that other applications can still get the latestValue(“Temperature”)…


(Steve Herrell) #5

Just one more observation. In the simulator I can leave the tile without “decoration: flat” and it works but I have to add it for the tile to work on an Android device, otherwise all I get is a “- -” showing on the tile.

I’ll try on an iPad tonight.