Migration from zigbee2mqtt / network key?

Hello,

I used zigbee2mqtt for quite a while now when my CC2531 was runnning on another machine. Now I have it connected to my Hass Pi and wanted to use the ZHA integration. Since I have a lot of Xiaomi/Aqara devices that are a pain in the ass to pair (if at all) I really really really want to reuse my old network and network key. Is there anyway I can do that?

Also I get an “unknown error” when ZHA Permit service, but the device is correct since I can control some IKEA lights that for some reason auto joined. Can I still use the “Add devices” under Integration → Devices → Add Device? So far I had no luck, but it might as well be the stupid xiaomi sensors…

Thanks

You could maybe try asking the developers of https://github.com/zigpy/open-coordinator-backup/

Hot migration will almost certainly not be possible so don’t just move the adapter, however, zigbee-herdsman and zigpy use the same network backup format so could perhaps instead try to backup and restore of your network. That is, first backup your network to file before move adapter and only then move adapter and try restore the network from file.

Disclaimer is that I have not tried it myself so best check with those developers regardless, and please do help update the ZHA documentation if it do work.

https://github.com/Koenkk/zigbee-herdsman/pull/395

https://github.com/zigpy/zigpy-znp#tools

https://github.com/zigpy/zigpy-znp/blob/b60f7c18bf4faf1de8a97418170838dd4e6bb84f/TOOLS.md#backup-and-restore

PS: Note that CC2531 is no longer recommended so better if could restore to a new CC2652, see ex.:

https://electrolama.com/projects/zig-a-zig-ah/

I migrated from zigbee2mqtt to zha simply by uninstalling zigbee2mqtt and then installing zha. All my devices were discovered without putting them in pairing mode. Devices consist of Tuya TRV, tradfri repeaters, sonoff: button, temp humi sensor, door sensor, motion sensor. I assume therefore that either the keys are held on the USB adapter or ZHA has another way to find it.

I am preparing to migrate back to z2m since I am having some issues with the TRVs and sonoff devices - with the TRVs very minimal functionality is exposed in ZHA, there are no schedules, no presets and they keep reverting to 16C by themselves. I cannot raise a issue in github since my installation is unsupported, because I have photoprism running in docker that is not part of HA and having other docker containers is unsupported on a Supervised install.

1 Like

Hey did you managet to migrate from ZHA to Z2M? I’m currently using ZHA (with the Sonoff ZBBridge flashed with Tasmota) and want to migrate to Z2M (with a new CC2652R stick). Of course I’d like to avoid having to re-pair all devices!

Yes, I migrated back to Z2M and did not need to do any pairing again. Assuming that the keys or whatever are on the USB stick or otherwise held in HA somewhere that is accessible to both ZHA and Z2M

1 Like

That’s great to hear! I ended up re-pairing all devices, but it was much quicker and easier to pair with Z2M compared to ZHA IMO. Thanks!