I have just “finished” the migration from ZHA to Zigbee2MQTT.
I air-quoted the “finished” because I still have some issues to figure out, specifically:
- Z2M has crashed on me (see another thread).
- Z2M seems slower than ZHA - specifically when I walk into a room and IR sensor turns the light one.
I am still working on both of those issues so I may be able to find a resolution.
Moving Hardware
With respect to simply moving HA+ZHA to new hardware I run HA under docker and I believe that helps with the mental model, because I view my setup as having 4 components:
- The “config” directory which contains all the automation, scenes and the registry of paired devices.
- The Co-ordinator (I now have two: a Sonoff Dongle and a Connect ZBT-2).
- The docker image (Home Assistant Software).
- The hardware (Mini PC) that runs Docker and HA.
If you switch out the hardware (PC) but transfer the first 3 components to the new machine you effectively transfer everything over (so it should just work).
With respect to #3 (the docker image) as long as you update to the latest version before moving to new hardware you can just download it again on the new machine (it will be the same version) so you don’t really need to “transfer” it.
Hence once you have a new PC setup (hardware + docker + HA) all you need to do to transfer your setup is:
- Stop HA on both old and new machines.
- Copy the config directory from old to new.
- If you have a USB co-ordinator move it from one machine to the other.
- If you have a network co-ordinator make sure the new machine can access it.
- Start HA on the new machine.
Installation Cleanup
I was pretty happy with my automations and the scenes on my setup.
However the names of all my Zigbee devices was a complete mess.
To that end I decided to kill two birds with one stone:
- Fix the names of the devices.
- Migrate from ZHA → Zigbee2MQTT
Note: I think there are scripts which the migration for you, but I didn’t want to use them as I wanted to do the cleanup.
That’s why I purchased the second co-ordinator (Connect ZBT-2), so that:
- I could continue to run ZHA on the Sonoff
- Added Zigbee2MQTT on the new coordinator (running on a different channel).
Over time I moved one room at a time from ZHA to Z2M fixing the naming of the devices as I went.
Wired Devices
The migration of the wired devices was smooth:
- I put Zigbee2MQTT in pairing mode.
- Then deleted the device from ZHA.
- The light bulbs were the most obvious they cycle colors RGB as they leave ZHA.
- Then they flash as they connect to the Zigbee2MQTT
- Finally I updated the names of the devices in the Zigbee2MQTT
- Remember to check the checkbox to also rename in HomeAssistant.
Note: It helps to have two browser tabs open for ZHA and Zigbee2MQTT
Battery Devices
Are not as smooth as wired devices.
You do the same thing as you do for the wired devices, but after you kick them off ZHA you need to factory reset them:
- Hold the button (or)
- Paper-clip them.
Be careful of contact sensors I found that if their state changes (you open the door) they have a tendency to rejoin the old ZHA network.
TL;DR - You have to paper clip them immediately after kicking them off ZHA.