Is there any config keyword to add here?
Bridge mqtt:broker:mosquitto “Mosquitto” [ host=“localhost”, port=1883, secure=false, username=“USERNAME”, password=“PASSWORD”, clientID=“openHAB2” ]
{
There shouldn’t be any difference for lwt messages and regular messages from the subscribers perspective. The client (i.e. Sonoff) registers a lwt topic and message when it connects to the broker and if it disconnects from the broker, the broker publishes the message to that topic. From OH’s perspective, it’s just another message. There is nothing special to set up except a Channel to subscribe to that topic.
Can you confirm that the lwt message is indeed being published using MQTT.fx or mosquito_sub? If not the problem is with either the Sonoff or Mosquitto.
If it’s configured to be retained then yes. If not then it’s ephemeral. If a client doesn’t happen to be subscribed when the message fires it’s lost to the ether.
The client (i.e. the device sending the message or in this case configuring the lwt message to be sent on it’s behalf) defines whether the message gets retained or not. That parameter on the MQTT Broker Thing does not control that. I’m not sure that parameter on the broker does anything at all.
You topic is different. OP here is using Mosquitto. You are having problems with the Embedded Broker.