How Does Zigbee2MQTT Work with Home Assistant?
Home automation systems frequently bring together devices from multiple manufacturers, such as Zigbee lights, switches, sensors, smart plugs, thermostats, and curtain controllers. Coordinating them through a single platform depends on dependable communication between devices and services.
Home Assistant is a widely adopted smart home platform, offering extensive integrations and automation capabilities. For Zigbee devices, it supports several integration options, including Zigbee Home Automation (ZHA) and Zigbee2MQTT.
Zigbee2MQTT connects Zigbee devices to an MQTT-based messaging system. Rather than using a proprietary Zigbee hub, it relies on a compatible Zigbee coordinator and converts device communications into MQTT messages for other applications to handle.
Once connected to Home Assistant, Zigbee2MQTT enables users to add, monitor, control, and automate supported Zigbee devices from a centralized interface.
Learning how Zigbee2MQTT works alongside Home Assistant helps developers, integrators, and smart home users build more adaptable systems and manage device compatibility and communication more effectively.
What Is Zigbee2MQTT?
Zigbee2MQTT is open-source software that connects Zigbee devices to an MQTT broker. Using a Zigbee coordinator, it communicates with Zigbee devices and converts their messages into MQTT messages.
The software serves as a bridge between two communication technologies:
- Zigbee: A low-power wireless mesh networking protocol used by smart home devices.
- MQTT: A lightweight messaging protocol for exchanging information among devices, applications, and automation systems.
- Zigbee2MQTT enables compatible Zigbee devices to communicate with other systems without requiring a separate integration for every device.
For example, a Zigbee motion sensor can send an occupancy event to the Zigbee coordinator. Zigbee2MQTT receives the event, converts it into an MQTT message, and publishes it to a topic. Home Assistant can then receive that message and use it to trigger an automation.
Zigbee2MQTT also supports control in the reverse direction. Home Assistant can publish an MQTT command, which Zigbee2MQTT translates into a Zigbee instruction for the intended device.
What Is Home Assistant?
Home Assistant is an open-source platform for home automation that connects, manages, and automates smart home devices and services.
It offers a central interface for controlling devices, setting up automation rules, tracking sensor data, and creating dashboards.
Home Assistant supports a wide range of communication technologies and integrations, including:
- Zigbee
- MQTT
- Wi-Fi-enabled smart devices
- Bluetooth
- Matter
Thread through compatible integrations and infrastructure
- Modbus
- A variety of cloud-based and local APIs
In a system built around Zigbee2MQTT, Home Assistant serves as the automation and management platform, while Zigbee2MQTT bridges communication between the Zigbee network and MQTT.
By separating these roles, users can build a smart home in which wireless device communication and automation logic are handled by distinct components.

YC-SM43P ESP32 4″ Smart Touch Panel
How Zigbee2MQTT Works with Home Assistant
The integration relies on several components working together.
1. Zigbee Devices
Zigbee devices serve as the wireless endpoints in a smart home. They may include smart bulbs, switches, sensors, plugs, curtain controllers, and other supported products.
Each device communicates over the Zigbee network according to the functions it supports.
2. Zigbee Coordinator
The Zigbee coordinator creates and manages the Zigbee network. It typically connects to the system running Zigbee2MQTT through a compatible USB adapter, serial interface, or network-based adapter.
The coordinator receives messages from Zigbee devices and sends commands to them.
3. Zigbee2MQTT
Zigbee2MQTT operates as a separate application or service. It communicates with the coordinator, identifies device capabilities, and converts Zigbee messages into MQTT messages.
It also receives MQTT commands and translates them into Zigbee instructions.
4. MQTT Broker
The MQTT broker manages message delivery. It receives published messages and forwards them to clients subscribed to the appropriate topics.
For example, Zigbee2MQTT can publish a light’s current state to an MQTT topic. Home Assistant or another client can subscribe to that topic to receive updates.
5. Home Assistant
Home Assistant connects to the MQTT broker and uses device information and messages to create entities, display device states, run automations, and provide user controls.
When MQTT discovery is enabled in Zigbee2MQTT, supported devices can be added to Home Assistant automatically, without the need to create each entity manually.
Zigbee2MQTT and Home Assistant Architecture
A typical system looks like this:
Zigbee Devices → Zigbee Coordinator → Zigbee2MQTT → MQTT Broker → Home Assistant
Each component performs a different function:
| Component | Main Function |
|---|---|
| Zigbee devices | Send sensor data and receive commands |
| Zigbee coordinator | Manage the Zigbee wireless network |
| Zigbee2MQTT | Translate Zigbee communication into MQTT messages |
| MQTT broker | Route messages between MQTT clients |
| Home Assistant | Manage devices, dashboards, and automation |
In this architecture, Zigbee2MQTT and Home Assistant are not directly communicating through the Zigbee radio. MQTT provides the communication channel between them.
The Zigbee coordinator is responsible for wireless Zigbee communication, while Home Assistant manages the broader smart home logic.
How Zigbee Devices Are Added to Home Assistant
Adding Zigbee devices with Zigbee2MQTT typically involves these steps.
Step 1: Install and Configure Zigbee2MQTT
Install Zigbee2MQTT on a compatible host, such as a Home Assistant system, Linux server, or another supported platform.
Configure the Zigbee coordinator, MQTT broker connection, network settings, and frontend, as needed.

YC-P3566-smart home control panel
Step 2: Connect the MQTT Broker
Home Assistant and Zigbee2MQTT must both be able to access the same MQTT broker.
The broker may run on the Home Assistant system or on another server on the network. Zigbee2MQTT and Home Assistant must use compatible MQTT connection settings.
Step 3: Enable Home Assistant Discovery
Zigbee2MQTT supports MQTT discovery for Home Assistant.
In the Zigbee2MQTT configuration, enable the Home Assistant integration:
homeassistant:
enabled: true
The MQTT integration must also be configured in Home Assistant.
When discovery is enabled, Zigbee2MQTT can publish device discovery information so Home Assistant can automatically create the corresponding entities.
Step 4: Pair Zigbee Devices
Enable device joining in Zigbee2MQTT, then put the Zigbee device into pairing mode.
After the device joins the network, Zigbee2MQTT interviews it to identify its supported functions.
Depending on the device, Home Assistant may create entities for:
- Switches
- Lights
- Brightness
- Color temperature
- Temperature
- Humidity
- Occupancy
- Battery level
- Contact sensors
- Device-specific functions
The entities available depend on the device model and the features it supports.
Step 5: Manage Devices in Home Assistant
After discovery, devices can be viewed and managed in Home Assistant.
Users can rename devices, organize entities, add devices to dashboards, and use them in automation rules.
This makes Zigbee2MQTT useful for projects that require a centralized interface for managing multiple Zigbee devices.
- How MQTT Communication Works
- MQTT uses a publish-subscribe model.
Instead of sending information directly between every device, clients publish messages to topics. Other clients subscribe to those topics to receive messages.
For example, a Zigbee light may use topics such as:
- zigbee2mqtt/living_room_light
- A command topic might be:
- zigbee2mqtt/living_room_light/set
A command payload could be:
{
“state”: “ON”
}
The actual topic names and payload formats depend on the Zigbee2MQTT configuration and device.
Controlling a Zigbee Light
When a user switches on a light in Home Assistant:
- Home Assistant sends a command via MQTT.
- The MQTT broker forwards the message to Zigbee2MQTT.
- Zigbee2MQTT converts the command into a Zigbee instruction.
- The Zigbee coordinator transmits the instruction to the light.
- The light carries out the command.
- The updated status is sent back through Zigbee2MQTT and MQTT.
- Home Assistant updates the device’s status.
This exchange keeps the smart home interface synchronized with the physical device.
How Home Assistant Automation Works with Zigbee2MQTT
After Zigbee devices have been added to Home Assistant, they can be incorporated into automation rules.
Motion-Activated Lighting
A Zigbee motion sensor detects movement and sends an occupancy update to the coordinator.
Zigbee2MQTT forwards the event over MQTT. Home Assistant receives the update and runs an automation that turns on a light.
When the sensor indicates that the room is vacant, Home Assistant can start a timer or switch off the light after a set interval.
Temperature-Based HVAC Control
A Zigbee temperature sensor sends room-temperature readings to Home Assistant.
The automation platform can compare the reading with a target temperature, then activate heating, cooling, or another climate-control function.
Door and Window Monitoring
Zigbee contact sensors report whether doors or windows are open or closed.
Home Assistant can use these updates to show status, send notifications, trigger alarms, or modify HVAC settings.
Scene Control
Zigbee lights, switches, curtains, and other devices can be grouped into scenes.
For instance, a “Good Night” automation can turn off selected lights, close the curtains, and adjust the thermostat.

YC-SM43P smart home control panel
Zigbee2MQTT vs. ZHA in Home Assistant
Home Assistant supports different ways to manage Zigbee devices. Two common approaches are Zigbee2MQTT and ZHA.
| Feature | Zigbee2MQTT | ZHA |
|---|---|---|
| Zigbee management | Separate application | Home Assistant integration |
| MQTT requirement | Yes | No separate MQTT broker required |
| Device communication | Zigbee + MQTT | Zigbee through Home Assistant |
| Configuration | Zigbee2MQTT frontend and configuration | Home Assistant interface |
| Device compatibility | Depends on Zigbee2MQTT device support | Depends on ZHA and device support |
| Architecture | Separate Zigbee and MQTT layers | More directly integrated into Home Assistant |
| Customization | MQTT topics, converters, and configuration options | Integration and device-specific options |
| Additional infrastructure | MQTT broker | Zigbee coordinator and Home Assistant |
Zigbee2MQTT is useful for users who prefer MQTT-based communication, flexible device management, and a separate Zigbee service.
ZHA is suitable for users who want a more directly integrated Zigbee solution within Home Assistant without maintaining a separate MQTT-based Zigbee application.
Neither approach is universally better. The choice depends on the project, device compatibility, system architecture, configuration preferences, and maintenance requirements.


