Interaction with the MQTT broker is done through the self.mqtt
object in the rule or through the ~HABApp.mqtt.items.MqttItem
. When receiving a topic for the first time a new ~HABApp.mqtt.items.MqttItem
will automatically be created.
Mqtt items have an additional publish method which make interaction with the mqtt broker easier.
HABApp.mqtt.items.MqttItem
HABApp.mqtt.items.MqttItem
An item that consolidates a topic that reports states from a device and a topic that is used to write to a device. It is created on the topic that reports the state from the device.
HABApp.mqtt.items.MqttPairItem
HABApp.mqtt.items.MqttPairItem
Since this event inherits from ~HABApp.core.events.ValueUpdateEvent
you can listen to ~HABApp.core.events.ValueUpdateEvent
and it will also trigger for ~HABApp.mqtt.events.MqttValueUpdateEvent
.
HABApp.mqtt.events.MqttValueUpdateEvent
HABApp.mqtt.events.MqttValueUpdateEvent
Since this event inherits from ~HABApp.core.events.ValueChangeEvent
you can listen to ~HABApp.core.events.ValueChangeEvent
and it will also trigger for ~HABApp.mqtt.events.MqttValueUpdateEvent
.
HABApp.mqtt.events.MqttValueChangeEvent
HABApp.mqtt.events.MqttValueChangeEvent
../conf/rules/mqtt_rule.py