MQTT Thing suddenly offline

Good afternoon

Anyone an idea why suddenly few MQTT things I have appear as offline but are still controllable?

When I click on the MQTT Thing and click on “save” it is immediately online again.

thanks in advance
richard

Not without a lot more details.

Assuming the Bridge (i.e. MQTT Broker Thing) is remaining ONLINE, the only other reason an MQTT Thing will go offline is if the MQTT Broker published the LWT message from the device. It helps to have a basic understanding of how MQTT works. See Getting Started with MQTT

But this all assumes a lot of configuration details you’ve not provided.

Didn’t actually configure anything besides installing mosquitto and MQTT binding…the esphome devices are then automatically discovered…

But as long all esphome devices are still controllable…then fine (o;

Still trying to figure out if I should move to OH or stick with hass.io…still unsatisfied with both systems :wink:

That’s an important detail.

I don’t know what protocol ESPHome uses but if it’s either Homie or Home Assistant that means that these devices configure a LWT message. This is a feature where when a client registers with an MQTT Broker, it give it a topic and a message and the broker promises to publish that message to that topic should that client ever stop responding.

In other words, it’s a mechanism to detect when a device falls offline through MQTT.

So what is probably happening is the ESPHome device stops responding to the heart beat established between it and the broker, the broker thinks it’s gone offline and publishes the LWT message. OH see’s that LWT message and marks the Thing as OFFLINE because the broker would have only published that message if it thought the device went offline.

Use an MQTT client like MQTTExplorer to watch the message traffic being published by your ESPHome devices and the broker to verify.

1 Like