-
-
Notifications
You must be signed in to change notification settings - Fork 132
3.3. MQTT client
ebusd supports MQTT handling by using the mosquitto library connecting to an MQTT broker. In order to use it, a running mosquitto instance is necessary (see mosquitto.org.
To enable MQTT support, a corresponding build is necessary and the MQTT port needs to be enabled (see --mqttport). The MQTT topic published to (and also subscribed to) can be adjusted by using the --mqtttopic option and defaults to "ebusd/%circuit/%name
" where "%circuit
" is replaced by the circuit name and "%name
" by the message name.
When MQTT is activated and the broker connection was established successfully, ebusd publishes to the topic all changed messages that match the default access level or that of the user "mqtt" (see "--aclfile
").
In addition to the message specific topics, ebusd also feeds the following general topics (where the "ebusd" prefix depends on how the topic is configured):
-
ebusd/global/running
: true as long as ebusd is running -
ebusd/global/uptime
: the uptime in seconds -
ebusd/global/signal
: true or false depending on the signal state
Due to the subscription to the topic, ebusd also allows actively sending messages on the eBUS. This is supported by using a specific suffix to the topic:
-
/get
: initiates an active refresh of a read message from the eBUS.
When the message was read, ebusd send the corresponding topic to MQTT. -
/set
: allows to send a write message to the eBUS (if the access level allows it, see above).