Transfer ZigBee coordinator & devices to a fresh install?

I’ve HA installed for quite a while, but it’s full of cruft and experiments and attempts at doing various configuration. I need to redo it, and I’m debating if I want to just start from a fresh install, or try and dig my way out of the current install.

My big question is for my ZigBee coordinator & devices is if I can just adopt the coordinator (TubeZB CC2652 ethernet coordinator) and not need to go around to every single device in HA and re-add them? Or would I still have to do that?

I’m not familiar with that coordinator, but I just transferred to new hardware and you should be able to restore your Zigbee configuration on the new device. In the end I went with a totally new install so I could migrate and test a bit at a time, but having done that I wouldn’t go that route again. Take good backups and be ready to restore to the old hardware if you must, but trust that you can make the switch in one step.

In my case, All my devices remained paired after I moved the USB Zigbee coordinator to the new machine, but I did have to rename most of them. Since I had a list of them in a spreadsheet, that went pretty easily. There’s an option on the device to rename all the entities after renaming the device, which allowed all my automations and templates to work without changing them.

Thanks! Sounds like it’ll be easy.

Although after some reading I’m contemplating switching to z2m, rather than staying with ZHA, which would make me re-pair everything, I think.

Some things to think about. After my travel next week.

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:

  1. The “config” directory which contains all the automation, scenes and the registry of paired devices.
  2. The Co-ordinator (I now have two: a Sonoff Dongle and a Connect ZBT-2).
  3. The docker image (Home Assistant Software).
  4. 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.

I wasn’t going to ask, but the previous post got me curious again…

Why switch from ZHA to Z2M?

I’m curious because I think I know some good reasons why someone might want to. To date, they haven’t really applied to me. I don’t use MQTT for anything else, and all the devices I do use work fine in ZHA. Are there other reasons?

To me, the reasons not to are pretty simple. Why add another couple of layers to the stack that the data needs to traverse before getting to HA? Why learn two more things (MQTT and Z2M)? Why incur the overhead, in both hardware and support time? I take the fact that someone needed a long, AI-generated post to describe the transition and the issues which came up as further evidence that I’m not wrong in my assessment. At least for me, for right now. Maybe some day.

I literally typed that whole reply - no AI at all.

There is additional functionality with MQTT:

  • Lights support Hue Effects.
  • Sensors allow changing timeouts and sensitivity.
  • … there may be more but those are the ones that I wanted.

I already know MQTT I have written my own bridge basically: X10_2_MQTT so that holds no fear to me.

I may want to directly implement functionality at the MQTT level - basically I can see the full state of all MQTT devices without going though Home Assistant.

1 Like

OK, I admit, I’m too quick to skip over anything which is nicely formatted, on the assumption AI did it. Someone else posted the abbreviation “TA;DR” which I’m finding applies to me more and more lately.

But, yeah, if you need the added functionality, or already run MQTT for other reasons, Z2M is a no-brainer. Except maybe if it introduces a delay. Even the tiniest delay can feel like an eternity when you flip a switch and expect an instant response.

This is the great thing about HA. We each get to make decisions like this for ourselves. Long live open source!

Well in my case, my switches/etc already go through Node-Red (custom logic, custom brightness and double tap increase brightness/etc/etc kind of thing). So there’s already a fractional delay, generally.

So reading ZHA vs. Zigbee2MQTT: Which One Should You Choose for Home Assistant? - Roei's Tips Stream made me consider that perhaps z2m might help some compatibility/features with some devices I have (or want to get).

As some background on installation, HassOS runs in a VM on my FreeBSD home server/NAS. So it’s “new hardware” in that it’d be a new VM, but otherwise it’s not truly new hardware, it’s just booting up a fresh installation image and doing some configuring.