I have been trying to set up a second Zigbee network.
I have Zha running fine with over 20 devices.
The reason to add the zigbee2mqtt network is that it will allow me to incorporate or add devices that are not in zha or that have more parameters and control on zigbee2mqtt.
HA is running in a Raspi 4 with a 4Amp power supply.
I have two Zigbee adaptors, one being used on the ZHA network and one just plugged in. Both are Sonoff ZB Dongle Plus E.
I also have a Zwave adapter and a Bluetooth adapter, so Im using a USB hub that works perfectly will all thatâs plugged in, including the Sonoff thatâs running ZHA.
1- Aside from the fact that by dividing your Zigbee devices into two separate groups, the network wonât be as solid, is there any other minus?
2- I couldnât find a clear guide to set up the second network ( Z2mqtt ), and I have been tinkering here and there with no results. (always âbad gatewayâ)
Any advice or help on this?
Tips from someone running both zha and z2mqtt?
Thanks!
Is there such a thing as a âsolidâ zigbee network? I wish there was. Sorry to say it but I think youâll be storing up a lot of troubles for yourself. Youâll have 3 networks using the available channels (assuming you have 2.4Ghz WiFi too), and youâll need to maintain two blocklists to stop each sensor from joining the wrong network.
Zigbee networks are capable of tolerating a degree of overlap (in case your neighbour has one too) but I wouldnât expect their co-existence to be painless. Youâll need to set a different PAN Id on the 2nd coordinator or at least check itâs been clever enough to get a unique one itself.
Out of interest how many devices are you planning to have in each network?
I run three zigbee nets on my HA (ZHA, z2m, and z2m-edge).
There are absolutely no issues doing so with just a little planning.
Zigbee â zigbee interference issues are overstated, but be aware of and plan accordingly. WiFi interference is the real issue,. ZHA defaults to 15, Z2M defaults to channel 11, so there wonât be out of the box zigbee conflicts. Z2Mâs zigbee 11 default is bad if using WiFi Channel 1 and may need to be changed.
It would be best to have separate zigbee channels, but if it comes down to hard choices, sharing zigbee channels would be better than having a zigbee-WiFi conflict.
@hunterdrayman is correct on setting pan_id. I always set the z2m pan_id, ext_pan_id, and network_key to something unique. I think ZHA does a better job at randomizing these than z2m, so you shouldnât have any conflicts even with the default z2m config.
Conversely, not sure what @hunterdrayman means about needing blocklists, unless he keeps permit_join turned on in z2m, which I always considered a bad idea. Iâve never used a blocklist and donât have any issues with devices joining the wrong net.
When you add a new end device to the network you canât pre-set its network selection on the device itself. So youâll have to disable joining, make an attempt at pairing, note its IEEE address in the logs and then tell your desired network to let it in and pair again. In zigbee2mqtt you can maintain blocklists/passlists so that re-pairing say, for debugging or after a battery change will be simpler. ZHA must have a way of doing this too.
On channel allocation, beware of local zigbee devices you have no control over. I discovered that my âsmartâ electricity meter was using the zigbee2mqtt default channel to talk to its dashboard display (which I donât use) and although I asked, my electricity supplier wonât disable their meterâs zigbee network. I ended up having to rig up a faraday cage with foil to stop it from interfering. For this reason I always would set the channel away from defaults if possible - although thereâs not much room. As @jerrm say, itâs always a good idea to set your own network encryption key.
I run two networks, ZHA and Zigbee2MQTT. The reason was I found many of my lights would only act as routers for other lights and were taking up valuable slots on the limited routers I had in the network. Also ZHA does not always play well with some manufacturers devices.
So I separated the lights, keeping them on ZHA and built a new network on Z2M first adding all the routers then slowly adding end devices. This seems to work a lot better and dare I say it almost rock solid.
Both ZHA and Z2M are running as Home Assistant Integrations including Mosquito.
I use the port âby-idâ to differentiate the two coordinators as turning on or off the hardware can affect the port naming, both plugged into my NUC running Proxmox. Example for Z2M Configuration of port below.
One point I missed when I did it was on Z2M make sure you change the network key from the default as its a security issue if you donât. Changing later means you have to repair all devices.
If you are in the UK then shielding your meter may impact the gas meter as its connected via zigbee to the electricity meter. Change the channel of your network is a better solution even if its a bit painful.
Adrunner, did you have to change anything like pan id? and if so, can you explain more what you had to change. i will be attempting to add another zigbee network this weekend. so i would like to be prepared