devWaves / SwitchBot-MQTT-BLE-ESP32

Allows for multiple SwitchBot bots and curtains to be controlled via MQTT sent to ESP32. ESP32 will send BLE commands to switchbots and return MQTT responses to the broker. Also supports Temperature, Motion, Contact sensors
MIT License
539 stars 66 forks source link

Added lastwill online to loop #13

Closed HardcoreWR closed 3 years ago

HardcoreWR commented 3 years ago

Added functionality to publish every 10s in loop()

I noticed this morning that my curtains were unavailable. It turned out that in the middle of the night there might’ve been a small network glitch that caused the esp to be disconnected to the broker for at least 60sec. It was still updating the curtain topics every 10min (I happened to have MQTT Explorer open so could see the history) but the lastwill topic changed to offline and didn’t go back to online (which is expected because we only set it at boot).