I recently started seeing an issue where temperature changes via HomeKit on my Alarm.com thermostat (connected via Z-Wave) sometimes revert after a few seconds. Changes from the HA UI work fine.
After some playing around with it, I’ve found that it always fails for certain temps. I can always set 74°F or 76°F successfully, but 75°F consistently fails. From looking at the logs, seems like the issue has to do with HomeKit sending values with floating-point precision errors.
From looking at the logs (brief snippet attached), it appears that the thermostat is rejecting the overly-precise value from HomeKit’s Celsius conversion, so the state change isn’t “sticking.” Home Assistant tries to send the Set command, then polls, gets the old value, and sets that as the new state.
I’ve tried everything from rebooting HA, factory resetting (and excluding/re-including) the thermostat, and deleting/re-setting up the HomeKit integration. The strange thing is that it was working fine for me 18+ months with this setup until recently. A few weeks ago I upgraded from a Pi 3 to a Pi 5 and had to rebuild everything from scratch. With the Pi 3 it had always worked fine, and when I first set up the new instance it worked fine. But about a week in this issue started happening. Haven’t been able to pinpoint what changed.
Found several GitHub issues (will link in reply) going back several years that are seemingly related to this same problem, so I’m having a hard time understanding why it worked for so long for me and then crapped out. Clearly there’s an underlying technical issue, but can’t be purely a code issue if it just now started failing for me.
Any ideas on fixes? Would it potentially work for me to just make a code change to try to more cleanly pass these values through Home Assistant?