Migrate from ZHA to Zigbee2MQTT in Home Assistant
Move a Home Assistant Zigbee network from ZHA to Zigbee2MQTT: what carries over and what does not, why every device needs re-pairing, and a step-by-step plan that keeps entity IDs and automations working.
There is no official way to move a network from ZHA to Zigbee2MQTT. Neither the Zigbee2MQTT nor the Home Assistant documentation describes one. This guide covers the approach that works on any coordinator: start a fresh Zigbee2MQTT network and re-pair every device, while keeping the Home Assistant entity IDs so automations and dashboards keep working.
If you have not decided yet, read ZHA vs Zigbee2MQTT first. On a home with many devices, the migration takes a visit’s worth of work.
What Carries Over and What Does Not
| Item | After the migration |
|---|---|
| Device pairing | Lost. Every device is reset and paired again |
| Device names and entity IDs | Lost, but you can give the new entities the old IDs |
| Areas | Lost. Assign them again |
| ZHA groups | Lost. Recreate them as Zigbee2MQTT groups |
| Automations, scripts, and dashboards | Kept, and work again once the entity IDs match |
| Coordinator | Reused, as long as Zigbee2MQTT supports it |
Why Keeping the Network Key Does Not Avoid Re-Pairing
Both stacks can read a coordinator backup, so it is tempting to copy the ZHA network settings (channel, PAN ID, extended PAN ID, and network key) into Zigbee2MQTT. That does not save the re-pairing:
- Zigbee2MQTT only knows devices that joined while it was running. It ignores messages from devices that are not in its own database, so devices from the ZHA network stay invisible until they join again.
- The ZHA backup is not in the format Zigbee2MQTT reads. The file
from ZHA’s Download backup button uses zigpy’s own format.
Zigbee2MQTT rejects it with
Unknown backup format. - A mistake wipes the network. If Zigbee2MQTT starts on the same coordinator with settings that do not match the network on it, it replaces that network with a new one. The only exception is a coordinator with a Texas Instruments chip, such as the Sonoff ZBDongle-P, when Zigbee2MQTT already has a network backup file: it refuses to start instead. A fresh Zigbee2MQTT install has no backup file, so this does not protect a migration.
The fresh-network approach below has none of these risks, and the result is the same: every device paired to Zigbee2MQTT.
Before You Start
- Check the coordinator. Make sure Zigbee2MQTT supports it and note which chip it uses (Texas Instruments, Silicon Labs, or ConBee). See Choose a coordinator.
- Take a full Home Assistant backup under Settings → System → Backups. It holds the ZHA configuration and the entity registry.
- Download a ZHA network backup from the ZHA configuration page. Keep it with the Home Assistant backup in case you need to go back.
- Make an inventory. For each Zigbee device, write down:
- its location and model
- its entity IDs (listed on the device page under Settings → Devices & services → Devices)
- whether it is mains-powered (a router) or battery-powered
- how to factory reset it (from its manual)
- Note the ZHA groups and their members. They have to be recreated.
- Plan the order. Routers first, room by room, starting near the coordinator. Battery devices come last.
Option: Use a Second Coordinator
A coordinator can only be used by one Zigbee stack at a time. With a second coordinator, you can run ZHA and Zigbee2MQTT side by side and move devices over in batches, so the home is never left without working Zigbee devices. With a single coordinator, all devices are offline from the moment ZHA is removed until they are paired again.
If you use a second coordinator, keep ZHA running and skip step 1 of the procedure below. Instead, delete each device from ZHA (its device page, ⋮ → Delete) just before you pair it to Zigbee2MQTT, which frees its entity IDs. Remove the ZHA integration once the last device has moved.
Migration Procedure
1. Remove ZHA
Go to Settings → Devices & services, open the Zigbee Home Automation integration, then select ⋮ → Delete. Home Assistant deletes the ZHA devices and entities with it, which frees their entity IDs for the new devices.
Do not just disable ZHA if you plan to reuse the entity IDs: the old entities keep their IDs while they exist.
2. Install Zigbee2MQTT
Follow the Zigbee2MQTT setup guide to install the Mosquitto broker and the Zigbee2MQTT app, and to complete the onboarding page. Keep the random PAN ID, extended PAN ID, and network key that the onboarding page suggests: this is a new network.
Pick the channel before you pair anything. Changing it later only works on coordinators with a Texas Instruments or Silicon Labs chip, and some devices then need re-pairing.
3. Reset and Pair the Routers
For each mains-powered device in your list:
- Factory reset it. A device still paired to the ZHA network ignores the new one.
- Select Permit join (All) in the Zigbee2MQTT frontend, or permit joining through a router you already moved that is close to the device.
- Wait for the interview to succeed.
- Rename the device right away (see the next step).
4. Rename Devices and Restore Entity IDs
Give each device a friendly name in Zigbee2MQTT, such as
kitchen/ceiling_light. Then make its entity IDs match the old ones:
- In Home Assistant, open the new entity under Settings → Devices & services → Entities.
- Open its settings and change the Entity ID to the one in your inventory.
- Assign the device to its area.
Most devices have several entities (a sensor often adds battery and signal entities, for example). Check each one against your inventory, not just the main one.
5. Pair the Battery Devices
Pair sensors, buttons, and other battery devices last, now that the routers form a mesh. Pair each one through a router near its final location, then rename it and restore its entity IDs as above.
6. Recreate Groups and Check Automations
- Recreate the ZHA groups as Zigbee2MQTT groups. See Groups.
- Open the automations and scripts that use Zigbee devices and check that none of them refers to an entity that no longer exists.
- Test the automations that matter most to the client: lights on motion, alarms, leak sensors.
After the Migration
- Check the network map a day later, once battery devices have reported in.
- Keep the old ZHA network backup and the Home Assistant backup until you are sure you will not go back.
- If a device does not pair, see Zigbee2MQTT troubleshooting.
Last modified November 30, 2026: Add a ZHA to Zigbee2MQTT migration guide (35a7e740)