Skip to content

Latest commit

 

History

History
159 lines (106 loc) · 4.48 KB

interface_mqtt.rst

File metadata and controls

159 lines (106 loc) · 4.48 KB

MQTT

Interaction with the MQTT broker

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.

image

Rule Interface

Mqtt item types

Mqtt items have an additional publish method which make interaction with the mqtt broker easier.

MqttItem

HABApp.mqtt.items.MqttItem

HABApp.mqtt.items.MqttItem

MqttPairItem

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

Mqtt event types

MqttValueUpdateEvent

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

MqttValueChangeEvent

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

Example MQTT rule

../conf/rules/mqtt_rule.py