Variable suddenly has a lot of decimals?!

I guess that Python suffers from that same “bug”:

Python 3.7.2 (default, Jan 28 2019, 12:25:20)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 0.2+0.4
0.6000000000000001

Yup. We tested ourself at work, with exactly Python (2 and 3) both have the same issue with float.
So hopefully Homey can circumvent it, although I do understand that it’s not the cause.

I have to restart this thread. I’ve tried all the different suggestions here, but now I have an issue where it will turn on the thermostat to heat if I set the temperature from f.ex 15 to 16 degrees, while it’s still 22 in the room…?

If I go from 16 to 15 again, it will go off.

I discovered this as I’m trying to make it work with Google Neat Hub as well, where it would snap back to the old values and a lot of decimals.

This is run every time the target temperature (variable) is updated.

I use this method for round if i want 2 decimals


So ,2 gives 2 decimals ,3 gives 3 decimals