klausahrenberg / WThermostatBeca

Replaces original Tuya firmware on Beca thermostat with ESP8266 wifi module
395 stars 96 forks source link

ME102H seems to loose MQTT connection - alive = false for no reason #287

Closed Rainerlan closed 1 year ago

Rainerlan commented 1 year ago

I had the following issue with 1.0.8 Beta on my ME102H: Some sensors seem to loose the MQTT connection - When using mosquitto_sub, I was not able to see the status report every 5 minutes anymore. Also my HA climate-sensor did not find the availability topic (availability_topic: "/thermostat/properties") and so the sensor-card did not show any content. Interestingly, the config page of the sensor (and all other pages aswell) was perfectly accessible still.

So I went to 1.1.1 Beta After a few reboots, the device replied back status updates when sending empty messages to the properties-topic. But after a while it stops to do so, too. When stopping, the device reports (using mosquitto_sub) the following "property": {"idx":"therm5693070","ip":"192.168.178.135","alive":false} A reboot often does not solve the problem. The alive seem to become "false" and "true" every now and then - While the sensor is always perfectly well responding to http-requests (the config page)

So I guess, when alive is "false", MQTT stops. But...What could be the reason for the alive property to indicate "false", when the WIFI connection seem to be perfect?

Notes: In the meantime, I had a look into the Mosquitto broker's log - It disconnects the the client after 90s. So I wonder if the default keepalive is 90s (It seems to be not set in the sources) - but why only 2 out of 6 ME102H's get disconnected...

Rainerlan commented 1 year ago

Hi, in case anyone may find similar problems: The problem was not related to the thermostat - but to the HA-instance: influxdb took ~225% CPI load on my Raspi 4 on a 32bit lite OS. After I transitioning to the 64bit Lite OS, the high load of influxdb is gone - and sind then the problem with the thermostat (seemed) to go offline/disconnected did not appear again.