Best of both worlds - ZHA and Zigbee2MQTT

I’m using ZHA for my Zigbee netwoork but notice that using Zigbee2MQTT may provide additional functionality for some of my devices as well as open up the possibility to use devices not available through ZHA (yet).

I don’t want to convert my existing Zigbee network from ZHA to Zigbee2MQTT as the thought of re-pairing all my devices and adjusting automations fills me with dread.

Instead I’m thinking about buying another Zigbee coordinator and setting this up with Zigbee2MQTT. I’m thinking about having ZHA and Zigbee2MQTT running in parallel - each with their own coordinator dongle. I expect I’ll need to ensure that the new Zigbee network uses a different channel to my existing one.

Is it possible to have ZHA and Zigbee2MQTT running in parallel? Will it be easy to identify the new coordinator dongle when setting up Zigbee2MQTT?

Thanks for your help


Sure you could do that but the devices can only be paired with one or the other coordinator. Not both.

1 Like

Thanks @tom_l

There’s no problem running both. Theoretically they could run on the same channel, but it doesn’t make sense to have them interfering with each other.

I started with ZHA. Added Z2M, intending to only test an unsupported device. The ZHA devs added support for the device, but I ended up migrating almost everything to Z2M over the course of a month or so. I like the concept of ZHA’s approach, but Z2M is currently an easier implementation to use once installed.

Still have both running with just a couple devices on ZHA. ZHA is installed primarily to keep evaluating. I expect ZHA will eventually catch up with Z2M’s ease of use, and I’m not opposed to moving back when/if it makes sense.

Biggest issue using both in production would be building two separate robust meshes.

1 Like

Thanks @jerrm

I have a similar request. I want to install ZHA and zigbee2mqtt parallel in HA. But would like to use only one coordiantor. Is it possible that I can add the same zigbee device in both ZHA and zigbee2mqtt. i want to use ZHA primarily and leave zigbee2mqtt disabled. Then for OTA and other testing I would like to disable ZHA and enable zigbee2mqtt. Is this possible or do I have to pair the devices every time new?

I don’t see how it would be possible in a meaningful way, but @Hedda suggests it could be with the backup being added to 2022.9: ITead’s “Sonoff Zigbee 3.0 USB Dongle Plus V2” model "ZBDongle-E" based on Silicon Labs EFR32MG21 +20dBm radio MCU now sold for $19.99 - #44 by Hedda

Out of curiosity: why do you want to use ZHA then? Why not stay with Z2M for its features?

I find ZHA much easier to use than zigbee2mqtt.

Thanks for your reply. I guess I will just try it and see how it behaves if I just disable ZHA and enable zigbee2mqtt and vice versa.

You’ll need to restore a z2m backup to ZHA if the system will still let you.

They ended up removing mention of z2m restore from the 2202.9 release notes at the last minute. I don;t really know, but imagine the functionality is still there, but may need work, or just better docs.

I saw this original information and I think it could have been understood as wash&go solution. I’m pretty sure it doesn’t work straight way. It recreates zigbee network, but I doubt it is able to recreate the same entities (name and unique_id wise). It would result in the mess of doubled entities (suffixed with _2) or completely differently named entities, depending on naming convention applied in integration backup is restored.

Hi. Why is it not possible to run zha and zigbee2mqtt in parallel with a cooridnator?

You can with two coordinators. The coordinator can not be shared between the two.

I’ve done some testing an it is possible to move a coordinator back and forth between integrations without repairing, but you end up with two sets of entities. Might be useful for some limited testing purposes, but I wouldn’t recommend it beyond that.

I’ve had ZHA running very successfully with ConBee II stick for months. But I want to migrate from my Tado radiator valves to Zigbee vales because Tado does not allow HA to control the opening of the valve.

I bought a Ketotek valves to test only to find that it cannot be read by ZHA/ConBee combination. So I tried to install Zigbee2MQTT, but I have problems when I open the web UI.

My config is as follows:

data_path: /config/zigbee2mqtt
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: false
mqtt: {}
  port: /dev/ttyACM0
  adapter: deconz

The log after I start Z2M is as follows:

[20:24:40] INFO: Preparing to start...
[20:24:40] INFO: Socat not enabled
[20:24:42] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2023-04-06 20:24:44: Logging to console and directory: '/config/zigbee2mqtt/log/2023-04-06.20-24-44' filename: log.txt
Zigbee2MQTT:info  2023-04-06 20:24:44: Starting Zigbee2MQTT version 1.30.3 (commit #unknown)
Zigbee2MQTT:info  2023-04-06 20:24:44: Starting zigbee-herdsman (0.14.103)

I then click on Open Web UI and get the following error message:

502: Bad Gateway

The log file is now

[20:33:11] INFO: Preparing to start...
[20:33:11] INFO: Socat not enabled
[20:33:12] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2023-04-06 20:33:15: Logging to console and directory: '/config/zigbee2mqtt/log/2023-04-06.20-33-15' filename: log.txt
Zigbee2MQTT:info  2023-04-06 20:33:15: Starting Zigbee2MQTT version 1.30.3 (commit #unknown)
Zigbee2MQTT:info  2023-04-06 20:33:15: Starting zigbee-herdsman (0.14.103)
Zigbee2MQTT:error 2023-04-06 20:33:25: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-04-06 20:33:25: Failed to start zigbee
Zigbee2MQTT:error 2023-04-06 20:33:25: Check for possible solutions
Zigbee2MQTT:error 2023-04-06 20:33:25: Exiting...
Zigbee2MQTT:error 2023-04-06 20:33:25: undefined

I restarted Z2M and waited 3 min without clicking on Open Web UI and the log files is as below:

[20:39:03] INFO: Preparing to start...
[20:39:03] INFO: Socat not enabled
[20:39:04] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2023-04-06 20:39:07: Logging to console and directory: '/config/zigbee2mqtt/log/2023-04-06.20-39-07' filename: log.txt
Zigbee2MQTT:info  2023-04-06 20:39:07: Starting Zigbee2MQTT version 1.30.3 (commit #unknown)
Zigbee2MQTT:info  2023-04-06 20:39:07: Starting zigbee-herdsman (0.14.103)
Zigbee2MQTT:error 2023-04-06 20:39:17: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-04-06 20:39:17: Failed to start zigbee
Zigbee2MQTT:error 2023-04-06 20:39:17: Check for possible solutions
Zigbee2MQTT:error 2023-04-06 20:39:17: Exiting...
Zigbee2MQTT:error 2023-04-06 20:39:17: undefined

I have looked at the “zigbee2mqtt-fials-to-start” link but nothing seems to fit.

What should I change?

I’m guessing then that I would have to double all the repeaters and have one set for one network and the other set for the other network?


There is no doubt that Z2M supports more devices and that ZHA is easier (for me) to use, but I don’t want o double the number of repeaters.

So I am stuck. I’d like to use some TRVs which are supported by Z2M but not by ZHA, but the radiators are all over the house and too far from the second Zigbee coordinator. And I’ve tested some cover sensors that do not work on ZHA but pop right into Z2M.

But the thought of migrating by entire ZHA config to Z2M does not excite me. I have 50 devices and 362 entities running on ZHA. Is there an easy migration path?

1 Like

Did you ever get it fixed? I’m on the same page right now… :frowning:

I converted to Z2M and everything is running like a charm.

1 Like

Oke guys, for anybody ever looking for this problem. I will make a short guide in to what i had to do to get this to work:

First install zigbee2mqtt.
Then make sure your adapter is seen. you can run the following command in the terminal of home assistant to see you adapter(s)
Make sure you have the right one. Pull out the already used coordinator if nessecery to be sure.
And type over to replicate my picture.
You will have to use the device id, behind a certain line.
I have tried just using the port like : ttyACM0, but this didnt work for me.
Type this in terminal: ls -l /dev/serial/by-id

as you can see on the picture. i needed the top one of the 2 lines. and you can see what part i used in my config of zigbee2mqtt:

you will be able to see a line with a device id simular to my picture.
And make sure, if you have the sonoff dongle, to add in the ‘‘adapter: ezsp’’
This is important.

After that, you will have to change your config.yaml
Go to file editor/ zigbee2mqtt and in that folder to configuration.yaml

Remove all numbers behind: Network_id, Pan_id, Ext_pan_id

And make it like this
network_key: GENERATE
pan_id: GENERATE
ext_pan_id: GENERATE
channel: 25

i used 25 (same as my ZHA integration and works fine. but you could try another channel if you want)

Also, somewhere in the bottom of the yaml. file i added this:

permit_join: false

i read that this was sometimes nessecery, not sure if it is but you can try.

save it, reboot (yaml only will do i think)
And then restart zigbee2 mqtt and it should work)
If i missed a step, try some things you will read on these topics. But these where the things that helped me because i had to figure out how it works using 5 different forums.
Good Luck.

I’m also running ZHA & Z2M in parallel with 2 sonoff dongles and everything is working fine so far. Unfortunately after rebooting I sometimes get prompted with the following error message from ZHA, which is resolved after restoring the settings with the backup.

Does someone know how to prevent the overwriting of the ZHA settings by Z2M?