Detecting power is restored via MQTT

Good morning,
I'd like to detect when power is restored to devices (using MQTT).
My node-red and MQTT servers are on a battery backup.
Any ideas other than watch for LWT messages?


LWT is the way to do it.


To add to Colin's suggestion, you might want to try using the extended features of MQTT v5 since it gives you more options if you want to use them.

1 Like

Not sure which version of Mosquito I have, but I'll check.

Does the basic LWT functionality not do what you want?