MQTT: Is it be possible to implement "real" LWT?

in the topic wled /cid/status the online status is transmitted, but if the power supply or WiFi is cut off, no offline.

Regards

If your controller input voltage has a large enough capacitor, it might have enough power left to transmit an “offline” MQTT message, but doubtful.

If your MQTT broker requires periodic updates, you could set up something that performs a JSON request periodically. If it fails to reply 3 times in a row, you could send a message to MQTT to alert it that the WLED instance is offline.

Or, you could go cheaper and insert a large capacitor across the input voltage / common lines to the ESP, use a power supply that has a “failed” relay contact you could use to signal to WLED the power supply lost power.

Or, you could install a UPS, relay, redundant power supply (there are DC supplies designed to operate in parallel - but are fairly expensive compared to the ones we tend to use for WLED), and custom WLED usermod to handle it all.

Just depends on how important it is you keep WLED running, or are aware when power to WLED goes offline.

I am curious why MQTT broker is still running, but WLED lost power and went offline.

At this point, I feel like I completely did not understand what you want because LWT is not a defined acronym. Little WLED Timer?

This is not how LWT works :slight_smile: The server should automatically publish offline if the connection to the WLED device is lost.

@MeisterAdebar what MQTT broker do you use? It can take 2-5 minutes for the status to update after the device disconnects.

I understand what you want WLED to do now. You are asking for WLED to fully support LWT when MQTT is used.

Correct?

This is not how LWT works :slight_smile: The server should automatically publish offline if the connection to the WLED device is lost.

@MeisterAdebar what MQTT broker do you use? It can take 2-5 minutes for the status to update after the device disconnects.

yes you understood me

and sorry, I haven’t really dealt with the topic and the server reports an offline after a while.

You probably can’t start with the server I used, this is a module integrated in FHEM.

If you are able to speak German here is the thread:

FHEM WLED

I read every word of the last post (in the Deutsch forum thread). Understood at least 1/3 of it. However, I could not reply there without using Google translate to get at least 1/2 understood by forum readers.

Is the LWT WLED sends out not accurate or correct when it sends MQTT messages?

I’m not clear on what you really want. I’m sure that forum thread would make perfect sense to @Aircoookie - assuming he had the time to read all 8 pages (with the default posts/page).

I don’t think he fixed MQTT/LWT with the 0.13.0 release that just came out (~1hr ago).