bob1de / hass-apps

Some useful apps and snippets to empower Home Assistant and AppDaemon even more.
Apache License 2.0
85 stars 23 forks source link

[schedy] support for unit conversion rounding #55

Open devin122 opened 3 years ago

devin122 commented 3 years ago

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

ThatWileyGuy commented 1 year ago

I have the opposite problem - thermostats are natively Celsius but I use Fahrenheit. As best I can tell, that means...

... 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...