MQTT

What it is: A lightweight publish/subscribe protocol on top of TCP/IP, suitable even for low-power sensors. Clients connect to a broker, subscribe to topics and publish to them. The broker is the common interface through which everything exchanges data.1,2 In the smart home it's the bus between Zigbee2MQTT, network coordinators, Node-RED and Home Assistant.

How it works

According to Mosquitto docs1:

QoS Delivery When
0 at most once, no confirmation frequent sensor values
1 at least once, with confirmation (may arrive twice) regular commands
2 exactly once, four-step handshake where duplicates hurt

The subscriber chooses the maximum QoS it will receive. Higher QoS is more reliable but slower. The "When" column is Synthesis.

MQTT in Home Assistant

According to HA docs2:

Broker security (Mosquitto)

According to Mosquitto docs1:

Gotchas

Implementation and integrations

Related

Sources

  1. Mosquitto: mqtt(7) and mosquitto.conf(5) โ†— โ€” mqtt(7) and mosquitto.conf(5), i.e. the protocol and broker security.
  2. Home Assistant documentation (installation, concepts, backups, MQTT, ZHA, SMLIGHT, UniFi) โ†— โ€” the MQTT integration in HA (broker, discovery, birth and LWT).
  3. SLZB-OS (SMLIGHT Manuals) โ†— โ€” MQTT in SLZB-OS.
  4. Zigbee2MQTT documentation (Zigbee network, stability, binding, pairing) โ†— โ€” Zigbee2MQTT.