Best of both worlds - ZHA and Zigbee2MQTT

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
socat:
  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: {}
serial:
  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 https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html 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 https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html 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?

Hhmm.

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?

Thanks!

I’m glad it seemed to work for you! Unfortunately I cannot seem to make it work :frowning:
I feel like I have tried everything. Everything you noted I’ve tried and my current configuration looks like this:


(also doesn’t work when keeping mqtt empty)

[21:31:04] INFO: Preparing to start...
[21:31:04] INFO: Socat not enabled
[21:31:04] INFO: Zigbee Herdsman debug logging enabled
[21:31:05] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:debug 2024-02-13 21:31:06: Loaded state from file /config/zigbee2mqtt/state.json
Zigbee2MQTT:info  2024-02-13 21:31:06: Logging to console and directory: '/config/zigbee2mqtt/log/2024-02-13.21-31-06' filename: log.txt
Zigbee2MQTT:debug 2024-02-13 21:31:06: Removing old log directory '/config/zigbee2mqtt/log/2024-02-13.20-32-15'
Zigbee2MQTT:info  2024-02-13 21:31:06: Starting Zigbee2MQTT version 1.35.3 (commit #unknown)
Zigbee2MQTT:info  2024-02-13 21:31:06: Starting zigbee-herdsman (0.33.8)
Zigbee2MQTT:debug 2024-02-13 21:31:06: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/config/zigbee2mqtt/coordinator_backup.json","databaseBackupPath":"/config/zigbee2mqtt/database.db.backup","databasePath":"/config/zigbee2mqtt/database.db","network":{"channelList":[26],"extendedPanID":[59,141,204,150,41,194,170,223],"networkKey":"HIDDEN","panID":35917},"serialPort":{"baudRate":115200,"path":"/dev/serial/by-id/usb-dresden_elektronik_ConBee_III_DE03190138-if00-port0"}}'
2024-02-13T20:31:06.544Z zigbee-herdsman:adapter Failed to validate path: 'Error: spawn udevadm ENOENT'
2024-02-13T20:31:06.545Z zigbee-herdsman:controller:log Starting with options '{"network":{"networkKeyDistribute":false,"networkKey":[110,250,235,213,123,13,114,154,180,76,110,20,254,50,49,226],"panID":35917,"extendedPanID":[59,141,204,150,41,194,170,223],"channelList":[26]},"serialPort":{"baudRate":115200,"path":"/dev/serial/by-id/usb-dresden_elektronik_ConBee_III_DE03190138-if00-port0"},"databasePath":"/config/zigbee2mqtt/database.db","databaseBackupPath":"/config/zigbee2mqtt/database.db.backup","backupPath":"/config/zigbee2mqtt/coordinator_backup.json","adapter":{"disableLED":false,"concurrent":null,"delay":null}}'
2024-02-13T20:31:06.545Z zigbee-herdsman:adapter:zStack:znp:log Opening SerialPort with {"path":"/dev/serial/by-id/usb-dresden_elektronik_ConBee_III_DE03190138-if00-port0","baudRate":115200,"rtscts":false,"autoOpen":false}
2024-02-13T20:31:06.549Z zigbee-herdsman:adapter:zStack:znp:log Serialport opened
2024-02-13T20:31:06.550Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2024-02-13T20:31:06.551Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
2024-02-13T20:31:06.803Z zigbee-herdsman:adapter:zStack:znp:log Writing CC2530/CC2531 skip bootloader payload
2024-02-13T20:31:06.804Z zigbee-herdsman:adapter:zStack:unpi:writer --> buffer [239]
2024-02-13T20:31:07.805Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2024-02-13T20:31:07.806Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
2024-02-13T20:31:08.057Z zigbee-herdsman:adapter:zStack:znp:log Skip bootloader for CC2652/CC1352
2024-02-13T20:31:08.513Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2024-02-13T20:31:08.513Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
2024-02-13T20:31:14.515Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2024-02-13T20:31:14.515Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
2024-02-13T20:31:20.522Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2024-02-13T20:31:20.523Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
Zigbee2MQTT:error 2024-02-13 21:31:26: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2024-02-13 21:31:26: Failed to start zigbee
Zigbee2MQTT:error 2024-02-13 21:31:26: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2024-02-13 21:31:26: Exiting...
Zigbee2MQTT:error 2024-02-13 21:31:26: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:103:27)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
    at Zigbee.start (/app/lib/zigbee.ts:60:27)
    at Controller.start (/app/lib/controller.ts:109:27)
    at start (/app/index.js:107:5)

I’ve also tried starting Zigbee2MQTT with my ZHA disabled, without luck.

UPDATE: adaper typo fixed to adapter :sweat_smile: Works now!