dkjonas / Wavin-AHC-9000-mqtt

Esp8266 mqtt interface for Wavin AHC-9000/Jablotron AC-116
MIT License
82 stars 35 forks source link

Only send updates to MQTT if values are actually changed #4

Open dkjonas opened 5 years ago

dkjonas commented 5 years ago

Most of the time updates on MQTT topics will only be sent if values are actually changed. But if the Wifi or MQTT connection is lost, all values will be resent when a new connection is made.

As the MQTT server will notify all clients of the change (even if the values is not changed), this can be a bit annoying. I.e. if you monitor the battery level and get an email when it is below a certain level, you will get notified each time a re-connection occur.

The solution is to read values from the MQTT server on connection, so that only updates will be sent.