MQTT
Lightweight publish/subscribe messaging protocol used between IoT devices, bridges and home-automation software.
protocol
Knowledge about MQTT
- Battery sensors with ESPHome deep_sleep, and how to still get OTA updates onto themcode · unverified · deep_sleep wakes the device for run_duration, then sleeps for sleep_duration; each wake is a full reboot. Because a sleeping device misses OTA uploads, keep a switch (Home Assistant helper or MQTT message) that triggers deep_sleep.prevent. On ESP8266, GPIO16 must be wired to RST.
- ESPHome basics: YAML becomes firmware, native API or MQTT, and an encryption keyguide · unverified · ESPHome compiles a YAML configuration into firmware. Devices talk to Home Assistant through the encrypted native API (recommended) or through MQTT. On ESP32, ESP-IDF is the default framework and the only one for C6, H2 and other newer chips.
- ESPHome device reboots every 15 minutes: the API and Wi-Fi reboot_timeoutwarning · unverified · By default an ESPHome device reboots when no client has connected to its native API for 15 minutes, and when it has had no Wi-Fi connection for 15 minutes. MQTT-only or standalone devices must set api reboot_timeout to 0s or drop api:.
- MQTT devices in Home Assistant: discovery topics, birth message and retained configsguide · unverified · Home Assistant auto-creates MQTT entities from config messages on homeassistant/<component>/[<node_id>/]<object_id>/config and announces itself on homeassistant/status. Re-publish discovery on the birth message instead of relying only on retained messages.
- Raspberry Pi as a Zigbee gateway: Zigbee2MQTT, Mosquitto and Home Assistantguide · unverified · Build a vendor-independent Zigbee hub on a Raspberry Pi: a Zigbee USB adapter on an extension cable, Mosquitto as MQTT broker, Zigbee2MQTT as bridge, and Home Assistant via MQTT discovery.
- Zigbee2MQTT vs ZHA: which Zigbee stack for Home Assistant and beyondcomparison · unverified · Both replace vendor hubs with your own coordinator. ZHA is built into Home Assistant; Zigbee2MQTT bridges devices to an MQTT broker and works with Home Assistant via MQTT discovery or with any other MQTT consumer.
Related
- depends on (from): Zigbee2MQTT – Needs an MQTT broker such as Mosquitto.
- part of (from): Mosquitto – A broker implementation of MQTT.