Closed hollywoodscotty closed 8 months ago
@hollywoodscotty Which version are you using?
Owner
In HACS I see 0.7.0. Under device info I see Firmware: 3.03 and Hardware: Rev. H
@hollywoodscotty Thanks for this report. I was finally able to find the issue. Resolved in #30 which will be the 0.7.1 release. It is currently in testing and will be released in a few days when I am comfortable with it.
The problem here is with the conversion between Celcius and Fahrenheit that HA does and when it rounds. Basically:
To fix this (without trying to modify HA core):
It's hacky but it works.
Thanks again for the report.
"python rounds to even" that's bananas, but excellent catch. Thank you!
According to the docs https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex
round(x[, n]) | x rounded to n digits, rounding half to even. If n is omitted, it defaults to 0.
In C# which is my day-to-day language, it also rounds to even by default, however it also has a parameter for specifying the midpoint rounding, eg
double temperature = 72.5;
Console.WriteLine(Math.Round(temperature)); // 72
Console.WriteLine(Math.Round(temperature, MidpointRounding.AwayFromZero)); // 73
Console.WriteLine(Math.Round(temperature, MidpointRounding.ToNegativeInfinity)); // 72
Console.WriteLine(Math.Round(temperature, MidpointRounding.ToPositiveInfinity)); // 73
Console.WriteLine(Math.Round(temperature, MidpointRounding.ToZero)); // 72
Setting Target Tempurature to 73* F in Home Assistant, the number shows 73 in red for a moment, goes white, then shows to 72. Current Temperature shows as 72. On AprilAire app, temp and target temp are indeed 73. It appears my temps are off by 1 degree. However, when I set the target temp to 76 in Home Assistant, it stays 76 in Home Assistant, and the app also shows 76, so this issue is inconsistent. Device is 8840M.