Zigbee2MQTT - changing coordinator or adding a 2nd instance

Zigbee2MQTT gurus out there, I need some help.

I have a working Z2M network of around 100 devices, of which, a third are mains powered ie routers. My coordinator is a USB SONOFF ZBDongle-P and I have 2 SONOFF ZBDongle-Es flashed as routers. Last week, I tried to migrate the network over to a PoE SMLight SLZB-06 by following this video by Digiblur, to hopefully future-proof it. Note the tag line on the video says “Easy Zigbee2MQTT Migration” :joy:. Why do they always say that when it’s often not “easy” at all.

Suffice to say, despite following all the instructions to the letter, and a long discussion on Digiblur’s Discord chat, it didn’t work and Z2M would not start. So I left it for a few days and went back to a video I’d seen on adding up to 5 more instances of Z2M. This one:

Again, after following the instructions to the letter, I could not get a second Z2M instance to start, even with specifying the PoE coordinator in the 2nd instance’s configuration. Additionally, when I specified a new base_topic: zigbee2mqtt1 in the configuration of my exisiting network, as described in the video, Z2M generated new entity_ids: for all of my Z2M Groups :man_facepalming: so,again, not “easy”.

The error messages I’m getting are the same as those I was getting when I tried to migrate the network to the PoE coordinator:

[19:52:54] INFO: Preparing to start...
[19:52:54] INFO: Socat not enabled
[19:52:55] INFO: Starting Zigbee2MQTT...
Starting Zigbee2MQTT without watchdog.
[2024-07-22 19:54:04] error: 	z2m: Error while starting zigbee-herdsman
[2024-07-22 19:54:04] error: 	z2m: Failed to start zigbee
[2024-07-22 19:54:04] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-07-22 19:54:04] error: 	z2m: Exiting...
[2024-07-22 19:54:05] error: 	z2m: Error: network commissioning timed out - most likely network with the same panId or extendedPanId already exists nearby
    at ZnpAdapterManager.beginCommissioning (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:341:23)
    at ZnpAdapterManager.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:86:17)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:129:29)
    at Zigbee.start (/app/lib/zigbee.ts:63:27)
    at Controller.start (/app/lib/controller.ts:139:27)
    at start (/app/index.js:154:5)

and it just gets stuck in an endless loop trying to start.
From my interpretation of the errors, the most likely cause is this one:

z2m: Error: network commissioning timed out - most likely network with the same panId or extendedPanId already exists nearby

So after a bit of reading here:

I read about changing the pan_id: and ext_pan_id:using pan_id: GENERATE. However it says in the Z2M settings that a change of pan_id: will require all devices to be re-paired, so I wasn’t going to do that to my existing (and still working) Z2M instance running off the SONOFF ZBDongle-P coordinator. Instead, I tried to change the pan_id: of the 2nd instance of Z2M by entering pan_id: GENERATE in the serial configuration of the 2nd instance. Like this:

That didn’t work either and nor did entering the same lines in the mqtt section of the configuration. If I check the indentation of the corresponding section of my zigbee2mqtt > configuration.yaml file, the indentation of advanced: here wouldn’t be right as it should be in the same indentation as serial:

I’m almost at the stage where I’m thinking about trying to change the pan_id: of my existing network and just living with the prospect of having to re-pair all my devices, which I’m prepared to do. Unless someone can throw a different light on why neither of the above options is working for my network. The only other thing I can think it might be is the mains powered routers I have, specifically the 2 x SONOFF ZBDongle-Es I have. So I’m also going to power down ALL my mains-powered devices and try again with the 2nd instance.

Any comments welcomed, even if it’s just to say “crack on then” :joy:

Part of the reason for this post is that despite searching, I can’t find any thread in the Community that deals with this specific issue. So I just wanted a place where others who are trying to achieve this and getting as frustrated as I am can come to possibly find a solution to their own problems.

Thanks, and sorry for the long post.

1 Like

I’m in a similar position. I would have thought there would be a built in mechanism to change the coordinator. It’s this reason I’ve not installed my Sky Connect since I bought it at launch.

I used the SLZB-06m coordinator for a while with complete satisfaction. But when I switched to the Ember driver, the entire ZigBee network became very unstable. Starting z2m after a cold start was not possible. Only after a soft restart of z2m everything came online again. But many devices went offline afterwards.

I then purchased the SLZB-06 to rebuild the network from scratch. I use Proxmox so a new fresh container with zigbee2mqtt was quickly created. I used this article to recreate the network and since then it has been rock solid again.

SmartHomeScene: https://smarthomescene.com/guides/how-to-build-a-stable-and-robust-zigbee-network/

1 Like

I’m also running HA in Proxmox so was considering changing from the HAOS Addon to an LXC Z2M. It’s just the thought of rebuilding the entire network that is putting me off just now. I should probably just get on with it.

I feel for you. I had to re-pair about 85 devices. But it was worth it. First the routers and then the endpoints. Now it’s rock solid again!

1 Like

Yeah, I think I’m gonna set aside a day this week when no-one else is home to sort this. I’ll probably delete everthing after taking backups, unplug the SONOFF USB Dongle and start again with the SMLight.

Which Zigbee channel are you using? My current network is on Channel 11 with my 2.4GHz wifi using Channels 6 and 11, but I might push the Zigbee up to Channel 25 and switch to wifi Channels 1 and 6 :man_shrugging: :thinking:

I’m on channel 20 as my Wi-Fi is on 1 and 6 (1 is the nearest to the coordinator).

Channel 25 should work for you if you’re gonna use Wi-Fi channels 1 and 6.

Good luck!

1 Like

Mission accomplished!

I left the SLZB-06 on channel 11 and set the transmit power to 10, so 50% of max and all 93 devices are connected again. Some of the LQI numbers are quite low, lower than they were with the SONOFF USB dongle, but everything is working so I’ll keep an eye on connectivity and stability over the next few days and wind the power up if I think it needs it.

There are a lot more devices connected directly to the coordinator than before too, almost 40.

1 Like

Nice job! My network is now up-and-running for almost two weeks and still rock solid.

So did you have to repair everything or did you find a way to switch? I’m looking to switch my MQTT coordinator off of the Skyconnect and onto a new SONOFF USB but can’t seem to find an easy guide or self-explanatory was or doing so without repairing and setting everything up again.

I ended up repairing every device, which in itself was quite a good exercise as I started with all the router devices to build a good mesh, then added each end device to the nearest router.

It’s still worth trying to follow the guide in my first post. I’ve still no idea why it didn’t work for me, but there’s no real risk to your network in trying. You can easily switch back to your original configuration if it doesn’t work.