hass-apps
hass-apps copied to clipboard
[schedy] support for unit conversion rounding
The interface for my thermostat is all done in Fahrenheit, however my UI is set to use Celsius. This means that you get a slight rounding error when setting the temperature which causes keep retrying due to missing confirmation. Currently I'm working around the issue with
- x: "Postprocess(lambda result: round(int(result.value * 1.8)/1.8, 1))"
However that's rather inelegant and it would be nice if there was a more "baked-in" solution. Ideally I would suggest using the temperature_unit
and precision
properties of the climate entity, but I'm not seeing any obvious way of accessing that via appdaemon
I have the opposite problem - thermostats are natively Celsius but I use Fahrenheit. As best I can tell, that means...
- the thermostat firmwares still use Celsius internally
- the Zigbee messages still use Celsius
- Homeassistant converts to/from Fahrenheit in ZHA
- the thermostats convert to Fahrenheit to drive the displays
... and this means, for example, that Schedy will set a thermostat to 60.0F and it will actually go to 60.1F, seemingly because it gets converted to 15.5555C and rounded to 15.6C on the way out. Then Schedy will retry 10 times because the confirmation doesn't match what was requested.
I think I could probably do postprocessing step like you are, but I'm wondering if there's a more elegant way to describe the situation to Schedy so it recognizes what's going on...