platypush.backend.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]

Listen for events on a zigbee2mqtt service.

Triggers:

Requires:

__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 the platypush.backend.mqtt.MqttBackend client_id.

run()[source]

Starts the backend thread. To be implemented in the derived classes if the loop method isn’t defined.