mitsubishi2MQTT icon indicating copy to clipboard operation
mitsubishi2MQTT copied to clipboard

HVAC connection stuck

Open lightoze opened this issue 1 year ago • 2 comments

Periodically I get a situation when HVAC connection is stuck in disconnected state. Going to web interface and rebooting helps, so probably reconnect logic is not resetting connection state well enough. Perhaps it could be improved so that the connection is restored without the need to manually reboot?

lightoze avatar Nov 16 '23 11:11 lightoze

I have the exact same issue, and web UI reboot does fix it

sean-leach avatar Nov 16 '23 12:11 sean-leach

I implemented a workaround by adding this in the main loop() function:

         hpConnectionRetries = min(hpConnectionRetries + 1u, HP_MAX_RETRIES);
         hpConnectionTotalRetries++;
         hp.sync();
+        if (hpConnectionTotalRetries > 10 && mqtt_client.state() == MQTT_CONNECTED) {
+            ESP.restart();
+        }

lightoze avatar Jan 31 '24 08:01 lightoze