A simple rule to publish a retained message “ONLINE” to a configured topic when the MQTT Broker Thing changes to ONLINE. The topic is expected to be the same topic configured in the MQTT Broker Thing as the LWT message. The Broker Thing should also be configured to publish the “OFFLINE” message as retained so all clients will know the status of openHAB at all times whether or not they were subscribed to the topic when OH actually went online/offline.
The rule has two parameters:
|MQTT Broker Thing||Select the MQTT Broker Thing with an LWT configured.|
|LWT Topic||The full LWT topic configured in the MQTT Broker Thing|
- MQTT binding installed
- MQTT Broker Thing created and configured
- LWT configured on the MQTT Broker Thing
- LWT message configured to be sent as retained on the MQTT Broker Thing
- adjusted for breaking change, will no longer work for versions of OH prior to December 15th
- Made compatible with both Nashorn and JSScripting
NOTE: Will remove support for Nashorn sometime after OH 3.2 release.
- initial release