[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[mosquitto-dev] lwt and connection status for bridge
|
I have a broker on a computer A, and another broker on a computer C in a
differerent place. The C broker is configured to bridge to the A broker
and this works fine.
I would like to know, at A, if the bridge is connected. So I'd like
the bridge when connecting to post to /sensor/B/bridge/online as ON with
a lwt to write OFF.
Reading the man pages, I see in the bridge config:
notifications [ true | false ]
If set to true, publish notification messages to the local and
remote brokers giving information about the state of the bridge
connection. Retained messages are published to the topic
$SYS/broker/connection/<remote_clientid>/state unless otherwise set
with notification_topics. If the message is 1 then the connection
is active, or 0 if the connection has failed. Defaults to true.
This uses the Last Will and Testament (LWT) feature.
and I see that topic on A with value 1.
I interpret the LWT comment as being that if the broker at C is shut
down or disconnected for any reaosn (clean shutdown, crash, loss of
network connectivity, then I should see the topic value change to 0, and
can use that as a binary sensor in HA (to alert on loss of bridge).
Is that the right interpretation?