geoffdavis / esphome-mitsubishiheatpump

ESPHome Climate Component for Mitsubishi Heatpumps using direct serial connection
BSD 2-Clause "Simplified" License
583 stars 156 forks source link

Fix HA connection thrashing when no comms #34

Closed bulletmark closed 3 years ago

bulletmark commented 3 years ago

As discussed in issue #23, if the CN105 connection to the heat pump is down (i.e. unplugged, wrongly configured, etc), then the ESP device goes into a hard thrash loop where it is disconnecting and reconnecting to the HA server 2 times every second, i.e. it smashes the HA server ad-infinitum. This commit fixes this by ensuring the heat pump attributes are initialised to at least something non-random. We set the temperatures to NAN so it is clear they have not been initialised by heat pump, and thus apparent in logs etc.

geoffdavis commented 3 years ago

Thanks, this looks like the right approach.