Closed Roelaynd closed 7 months ago
Added LWT to the MQTT configuration.
This outputs a new "alive" parameter in the status JSON data. Normally a value of "1" is output during normal operation, should the controller go offline, that changes to zero - it can take a minute or two for the MQTT broker to realise.
emon/diybms/status {"alive":0}
Will test when I've got the possibility somewhere in the next two weeks.
It does indeed take a minute or two for the broker to notice, also signalling the alive status takes a couple of minutes. Works great for the purpose anyway!
Please correct me if I'm wrong, but it appears that the MQTT integration has no LWT (Last Will Topic)?
Could you please add this functionality if it isn't already? The other MQTT devices I have here have their LWT configured as "Online" when the connection is there and "Offline" when not. The benefit is that when logged, it can give insight in connection stability and such. Also it is an easy way to check for (Home Assistant) automations if the connection is still available and to act accordingly.
Background information: https://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament/