Migrating from ZHA to zigbee2mqtt

I have been having trouble with zigbee bulbs on zigbee ZHA network not responding at times but don’t go unavailable and after a reboot, or several reboots, of HA they start working normally. If I wanted to migrate to zigbee2mqtt from ZHA what are steps involved?

I have already installed and configured MQTT but only use for a single aspect unrelated to zigbee. What else would I need to do? Do I have to remove every zigbee entity and every zigbee device from ZHA first?

Yes, from my experience you need to remove the device from ZHA using the ZHA menu, then add the device to zigbee2mqtt using it’s add function. I would, if the device allows, add a step in the middle of these two and do a full reset of the device. For bulbs, this is often a sequence of powering the device on and off a number of times in rapid sequence until you get some ‘feedback’ from the device.

To complicated your life, if I were in your shoes, I would purchase a second zigbee coordinator device that is compatible with zigbee2mqtt. Set up a parallel zigbee HA setup to your ZHA and then migrate your devices one at a time. For the 20 bucks or so this second zigbee coordinator will cost you and the effort, I think you will find the transition easier than a mass transition (especially if you have a lot of devices) and second, you may find it useful to have both coordinators running for the long term, as this will give you the ability to compare ‘function’ of devices on the two different integrations. Unfortunately, you may find behaviors on one integration that is ‘better’, ‘different’, ‘weird’ in comparison to the other integration. Good hunting!

P.S. It sounds like you might have a routing issue with your current setup, I have some bulbs and other devices that do a poor job of acting as routers. Perhaps distance issue, or a device that does not do a good job of routing between another device and the coordinator. Also, a zigbee network can take several hours to ‘stabilize’, so rapid rebooting can just get you into a ‘chasing your tail’ sequence. All that said, you may find zigbee2mqtt to be more mature.

2 Likes

There shouldn’t be a distance issue since most of the bulbs are within 20 feet and no walls so it’s probably a routing issue since I have a lot of plugs that I setup so I could try and monitor power use. Most of the other bulbs are on zwave switches or are wifi bulbs.

I didn’t think it was possible to have two Zigbee networks in HA. How would I go about leaving the ZHA network and use zigbee2mqtt at the same time? Which other controller would be best? I have a HUSBZB-1 at the moment.

Distance is not always the problem with zigbee routing. Problems I have seen, some of which I mentioned, involved devices four or five feet apart with no walls.

You can not have two instanstances of ZHA in a single HA system currently. And if it was possible, it would not solve one of larger problems with open source zigbee today … issues in the code base. By having two different code bases, i have found that it often exposes problems that exist in one. zigbee2mqtt is completed isolated from HA and interfaces via MQTT. I find I prefer integrations that run outside the HA process space and interface with MQTT or other ways. I run these in docker containers or in dedicated machine.

I am not sure there is a ‘best’ coordinator device, many variables. I would read through the various forums, compare your devices with the goods and bads of other folks setups.

Yes I understand. That is why I mentioned it shouldn’t be a distance issue so it’s probably a routing issue. What I don’t understand is how to troubleshoot the cause and find the solution. Any ideas?

I looked up using zigbee2mqtt and I realized that the only coordinator that is available that I would be willing to use for zigbee2mqtt is the zzh! CC2652R Multiprotocol RF Stick so I ordered that one. It will be a while until I get it. So I’ll ask more about installing and running zigbee2mqtt once I receive it from Great Britain. As far as I can tell, the only way to run zigbee2mqtt is through HA if I am going to use it for HA. Is that correct? Being able to run both ZHA and zigbee2mqtt will be nice since that should prevent me from having to migrate all of the bulbs.

I remembered I have a zwave dimmer switch that I never installed and some spare dumb LED bulbs so I am going to replace it to remove the zigbee problem from one fixture with 4 bulbs. I’ll still have three other multi-bulb fixtures that will still work with zigbee so I’ll use zigbee2mqtt with those,once I get the zzh! and then I shouldn’t have to move any of the zigbee plugs or sensors since they all work without any issues with zha.

My two other options for moving away from zigbee for those fixtures involved more money or more work. Option 1 would be to get 10 TP-Link bulbs which would be too expensive or option 2 which would be to install Shelly or Sonoff dimmers inside the fixtures which I prefer to not have to do.

There a couple ways to use zigbee2mqtt with Home Assistant. I have never tried the HA official integration, so I cannot speak to that. I have a separate MQTT instance running outside HA and I run many types of sensors, switches and media control via this and HA’s MQTT interface. I use Shelly, ESPHome, custom ESP32 TV control, Zigbee and other devices this way. Read through the documentation at : zigbee2mqtt.io | 📘 Zigbee2mqtt documentation

Again, I am pretty sure you will be able to run both zigbee systems with HA, take your time setting up the zigbee2mqtt and make sure you have good HA backups. Get zigbee2mqtt running with maybe 1 device and get comfortable with it and as I said before move devices and a pace that allows you to explore the +/- of devices on each system.

Less is usually better in terms of integrations, but sometimes multiple is reality. I have 6 different zigbee systems running, far too many :wink: Hue, Ikea, Smartthings, Aqara, zha, home power meter…

Hope you get a stable setup soon!

1 Like