Z2M to ZHA Without Re-Pairing: A Beta Tool That Keeps Your Entity IDs

Z2M to ZHA Without Re-Pairing: A Beta Tool That Keeps Your Entity IDs. AutoMatter

A Home Assistant community member has shared a beta tool that moves a Zigbee2MQTT (Z2M) network over to ZHA, Home Assistant’s built-in Zigbee integration, without re-pairing a single device. It also keeps every entity_id, so history, long-term statistics, the Energy dashboard, automations and helpers carry on. The project is called z2m-to-zha, and the announcement thread is on the Home Assistant community forum.

What happened

The author moved a house of about 40 Zigbee devices, mostly Tuya, on a Z-Stack coordinator (a CC2652P). The repository reports a 64 second Zigbee outage; the forum post rounds that to about a minute. The motivation was to make Zigbee a native part of Home Assistant: one less add-on to update and keep running.

The usual route means re-pairing everything and starting history over. This tool avoids that because the network identity lives in the coordinator. It reuses those settings, then builds the ZHA database from Z2M’s own database and coordinator backup so ZHA never has to re-interview devices. Old MQTT entities are removed and the new ZHA entities are renamed onto the old IDs. Z2M stays installed but stopped, so rolling back is possible with the same IDs.

It also lists what ZHA will not take over: Z2M device options such as calibration or occupancy timeout, external converters, and MQTT consumers such as Node-RED. It can be run by hand or handed to a coding agent like Claude Code, since the repo doubles as an agent skill.

The honest status

This matters more than the headline. The method was proven end to end on the author’s own house with one-off scripts. The generic tool has only been verified read-only there. It has not yet done a full cutover on anyone else’s network. The author asks testers to run the assess and plan steps first and share the output, especially with a different coordinator or a larger mesh. Everything is read-only until you pass –yes.

Tested versions: HA Core 2026.11, zha 2.4.2, zigpy 2.4.1, zigpy-znp 1.1.1 and Zigbee2MQTT 2.14. Z-Stack is the only radio tested end to end. EmberZNet, deCONZ, ZiGate and XBee use generic zigpy calls but are untested. Moving between radio families is not what this does.

What it means for your system

  • Check your devices first. The author says ZHA does not support every device as well as Z2M. Some of their Tuya devices had no quirk or only partial support, so they wrote quirks, which are in the repo. Niche devices are the main risk.
  • Back up first. The tool has a backup step, but the README is blunt that you are responsible for your own backups and that this changes a live system.
  • Expect to lose some Z2M features. Calibration offsets and custom converters do not carry over automatically.
  • Anything on MQTT that reads Z2M topics will break. Plan for those consumers before you cut over.

What owners are asking

Do I need to move at all? No. As of today Zigbee2MQTT is a fully capable, mature option, and so is ZHA. Both are local and neither has a vendor cloud in the path. If Z2M works for you, there is no pressing reason to switch. The tradeoff is simply one more add-on and a broker to run versus a built-in integration.

Will my devices keep working in ZHA? Most likely, but not guaranteed. ZHA handles non-standard devices through quirks, and coverage differs from Z2M. Check each device before you commit.

Is it safe to try? The read-only commands are a reasonable way to see what would happen. A full cutover on a different network is untested, so we would wait for more reports unless you are comfortable with the rollback path and have solid backups.

Our take

Zigbee is the more mature option in Home Assistant, with a large proven catalogue, fully local control and very low power use, and working Zigbee gear does not need replacing. This tool is interesting because it removes the biggest fear about switching controllers. But with one successful cutover on record, treat it as a beta. If you run a client’s house, wait for a few independent success reports before touching it.

Sources