zigbee.mqtt
Platypush documentation
zigbee.mqtt
- class platypush.backend.zigbee.mqtt.ZigbeeMqttBackend(host: Optional[str] = None, port: Optional[int] = None, base_topic='zigbee2mqtt', tls_cafile: Optional[str] = None, tls_certfile: Optional[str] = None, tls_keyfile: Optional[str] = None, tls_version: Optional[str] = None, tls_ciphers: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None, client_id: Optional[str] = None, *args, **kwargs)[source]
Bases:
MqttBackend
Listen for events on a zigbee2mqtt service.
Triggers:
platypush.message.event.zigbee.mqtt.ZigbeeMqttOnlineEvent
when the service comes online.platypush.message.event.zigbee.mqtt.ZigbeeMqttOfflineEvent
when the service goes offline.platypush.message.event.zigbee.mqtt.ZigbeeMqttDevicePropertySetEvent
when the properties of a connected device change.platypush.message.event.zigbee.mqtt.ZigbeeMqttDevicePairingEvent
when a device is pairing.platypush.message.event.zigbee.mqtt.ZigbeeMqttDeviceConnectedEvent
when a device connects to the network.platypush.message.event.zigbee.mqtt.ZigbeeMqttDeviceBannedEvent
when a device is banned from the network.platypush.message.event.zigbee.mqtt.ZigbeeMqttDeviceRemovedEvent
when a device is removed from the network.platypush.message.event.zigbee.mqtt.ZigbeeMqttDeviceRemovedFailedEvent
when a request to remove a device from the network fails.platypush.message.event.zigbee.mqtt.ZigbeeMqttDeviceWhitelistedEvent
when a device is whitelisted on the network.platypush.message.event.zigbee.mqtt.ZigbeeMqttDeviceRenamedEvent
when a device is renamed on the network.platypush.message.event.zigbee.mqtt.ZigbeeMqttDeviceBindEvent
when a device bind event occurs.platypush.message.event.zigbee.mqtt.ZigbeeMqttDeviceUnbindEvent
when a device unbind event occurs.platypush.message.event.zigbee.mqtt.ZigbeeMqttGroupAddedEvent
when a group is added.platypush.message.event.zigbee.mqtt.ZigbeeMqttGroupAddedFailedEvent
when a request to add a new group fails.platypush.message.event.zigbee.mqtt.ZigbeeMqttGroupRemovedEvent
when a group is removed.platypush.message.event.zigbee.mqtt.ZigbeeMqttGroupRemovedFailedEvent
when a request to remove a group fails.platypush.message.event.zigbee.mqtt.ZigbeeMqttGroupRemoveAllEvent
when all the devices are removed from a group.platypush.message.event.zigbee.mqtt.ZigbeeMqttGroupRemoveAllFailedEvent
when a request to remove all the devices from a group fails.platypush.message.event.zigbee.mqtt.ZigbeeMqttErrorEvent
when an internal error occurs on the zigbee2mqtt service.
Requires:
paho-mqtt (
pip install paho-mqtt
)The
platypush.plugins.zigbee.mqtt.ZigbeeMqttPlugin
plugin configured.
- __init__(host: Optional[str] = None, port: Optional[int] = None, base_topic='zigbee2mqtt', tls_cafile: Optional[str] = None, tls_certfile: Optional[str] = None, tls_keyfile: Optional[str] = None, tls_version: Optional[str] = None, tls_ciphers: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None, client_id: Optional[str] = None, *args, **kwargs)[source]
- Parameters:
host – MQTT broker host (default: host configured on the
zigbee.mqtt
plugin).port – MQTT broker port (default: 1883).
base_topic – Prefix of the topics published by zigbee2mqtt (default: ‘
zigbee2mqtt
’).tls_cafile – If TLS/SSL is enabled on the MQTT server and the certificate requires a certificate authority to authenticate it, ssl_cafile will point to the provided ca.crt file (default: None)
tls_certfile – If TLS/SSL is enabled on the MQTT server and a client certificate it required, specify it here (default: None)
tls_keyfile – If TLS/SSL is enabled on the MQTT server and a client certificate key it required, specify it here (default: None) :type tls_keyfile: str
tls_version – If TLS/SSL is enabled on the MQTT server and it requires a certain TLS version, specify it here (default: None)
tls_ciphers – If TLS/SSL is enabled on the MQTT server and an explicit list of supported ciphers is required, specify it here (default: None)
username – Specify it if the MQTT server requires authentication (default: None)
password – Specify it if the MQTT server requires authentication (default: None)
client_id – MQTT client ID (default:
<device_id>-zigbee-mqtt
, to prevent clashes with theplatypush.backend.mqtt.MqttBackend
client_id
.