Zigbee network optimization: a how-to guide for avoiding radio frequency interference + adding Zigbee Router devices (repeaters/extenders) to get a stable Zigbee network mesh with best possible range and coverage by fully utilizing Zigbee mesh networking

But it seems I can add more routers even in this situation where I am full. I can’t add end devices though without adding new routers. But for sure I don’t have to delete any end devices to add new routers. I don’t know the limit with routers. It probably goes towards the 1000s. :slight_smile:

Note! Due to new higher security requirements in the Zigbee 3.0 specifications, Zigbee 3.0 coordinators can only support a limited amount of Zigbee 3.0 devices. For older Zigbee Coordinators that uses the older Zigbee Home Automation 1.2 there is is no limit on the max number of Zigbee 3.0 devices that can join because they will connect in backwards-compatible mode (e.i. not use the higher security).

As I tried to explain above, while the theoretical limit for total amount of devices you can add to your Zigbee network if they use older Zigbee specifications is 64,000 nodes per network, but you will unfortunate hit the bottleneck of the Zigbee Coordinator running out of RAM (i.e. data memory) much sooner if you have a Zigbee 3.0 network and connect Zigbee 3.0 devices that use that newer protocol. Meaning that it will in practice not be possible to connect more Zigbee 3.0 devices than your Zigbee Coordinator has computational and data memory (RAM) to handle.

Again, the newer Zigbee 3.0 protocol have much better security which as a downside adds much higher overhead as each device you takes more RAM-memory, especially for the onboard RAM (i.e. data memory) of the Zigbee Coordinator, and in practice your Zigbee Coordinator will run out of much RAM sooner that you will hit any theoretical limits what the Zigbee specification can handle.

For reference, the most popular “modern” MCU radio SoCs used in Zigbee Coordinator adapters today are EFR32MG21 (running EmberZNet Zigbee stack/firmware from Silicon Labs) and CC2652P (running Z-Stack Zigbee stack/firmware from Texas Instruments) which both feature up to 96 kB of RAM depending on the specific SKU model uses, and those have been proven by members in the ZHA and Zigbee2MQTT community to at most handle around 200 Zigbee 3.0 devices in total on the same Zigbee network (note that is in total including those connected via Zigbee Routers and not only directly connected devices.

The newer generation’s of Silabs Zigbee MCU radio SoCs are; EFR32MG24 which can up to 256 kB RAM data memory, while the even newer EFR32MG24 can up to 512 kB RAM data memory. Similarly goes for TI’s CC2674 (CC2674P/CC2674R) and CC1354 (CC1354P) which can have up to 296 kB RAM data memory. I do not think it has been proven by members in the ZHA and Zigbee2MQTT community, but at least in theory if your existing Zigbee Coordinator is a CC2652P with 88 kB of RAM data memory can handle a maximum of 200 Zigbee 3.0 devices in total then is logical that the newer CC2674P with 296 kB RAM data memory should have no problems handling 500 Zigbee 3.0 devices in total.

So again, it is only OK to add more devices if and when you just add older Zigbee devices that use the now old Zigbee Home Automation 1.0 (or Zigbee Light Link 1.0) protocol specifications that you can connect 1000+ devices (probably only a few thousands of older Zigbee devices as the adviced workable limit). But would want to only use older devices today?

Summery; if you already have a EFR32MG21 or CC2652P based Zigbee Coordinator today then there should not be any need for you to replace it with a newer model until either you reach that approximate 200 Zigbee 3.0 device limitation when it runs out of RAM or until the MCU SoC manufacturers stop maintaining your old MCU SoC model and thus you can not get firmware updates with bug-fixes/security-patches.

1 Like

Hedda,
There are some devices that “pollute” the network with a lot of information, making it unstable. Some MMW and Tuya energy meters, for example.
In these cases, do these devices end up consuming a lot of the coordinator’s RAM memory or do they cause other types of problems?

1 Like

Those kinds of problem devices usually cause by other problems as they either flood the Zigbee network (basically jaming it so no other devices get a free alot in to send their messages) or in the case of some Tuya, Aqara, and Xiaomi Zigbee Router devices they will not router/fordware messages that are not using the same brand (essentially creating a black-hole that swallow and kill messages from other brand devices that connect to them). This is why it is usually ok to buy battery-powered devices from those companies but you should be extra careful before buying any mains-powered devices from those companies if they are meant to act as Zigbee Router devices, (nothing that you can not disable the routing feature on Zigbee Router devices).

2 Likes

Thank you, Hedda, for all the info.

This is how my network looks like now while testing an interactive project where I need to use 100 switches.

I have 102 end devices running. I think I need to add more routers for a more stable network.

BTW, Do you know why the device on the left is shown as not being connected? It does work. Is it a problem that it does not show as being connected to a router of the coordinator?

Thank you!

Yeah you deffinitivly need to add a few more Zigbee Router devices and place those in strategic places for best coverage. Suggest you start by adding additional Zigbee Router devices closer those that connect directly to the Zigbee Coordinator and wait until they move.

Best practice is that each device should preferably also be placed so that it is within range of a at least two Zigbee Router devices for redundancy so each device can have multiple paths if any one device break.

You should open and issue in Zigbee2MQTT repository on GitHub with logs for that but you should first try power-cycle the Zigbee Router closest to it and then also reset the device itself.

Here is by the way a new video from Linus Tech Tips demonstrating what happens to WiFi connections and data transfers (which are always relativly high-power) when your neighbors WiFi-routers use the same Wi-Fi channel as you (or you yourself have multiple access-points. From that you can use your imagination and draw your own conclusions what will happen to your Zigbee devices and Zigbee Coordinator (which are all always low-power) when they are trying to use the same or a close frequency range as yours or your neibours Wi-Fi channels:

Also keep in mind and remember that Wi-Fi channels have sideband lobes that spread out wider than you might think:

Wi-Fi’s three non-overlapping channels (1, 6, and 11) use the exact same frequencies as ZigBee channels 11-22.

ZigBee channels 25-26 aren’t immune either, because they can be caught in Wi-Fi channel 11’s sideband lobe (see ”Sideband Lobes” below). ZigBee channel 26 is usually relatively unaffected by Wi-Fi, but many ZigBee devices do not support it.

Sideband Interference

An 802.11g/n signature in the spectrum has two components: The 20 MHz “square” section that contains the data subcarriers Sideband lobes on each side, which are a normal side effects. Sideband lobes might not carry Wi-Fi data, but they are fully capable of drowning out ZigBee transmissions.

Data Subcarriers and Sideband Lobe

image

Sideband lobes are usually only visible when you are very close to to the device that is actively transmitting (try doing a speed test or streaming an HD video). This is especially evident when your ZigBee access point and Wi-Fi access point are in very close proximity with each other (like in the same comm closet).

1 Like

Considering each router supports 6 end devices, if one router breaks, what happens with the end devices that used to connect to it, considering the other close by routers are full?

I mean for sure I can fix this problem by having so many routers to cover for 1 or 2 router losses.

But I am still curious what would happen if you don’t have extra.

[quote]
You should open and issue in Zigbee2MQTT repository on GitHub with logs for that but you should first try power-cycle the Zigbee Router closest to it and then also reset the device itself. [/quote]

No idea how to quote again ;))

But the device works. It is just not connected in the map. :confused:

Again, one recommended partial workaround for all those kind of problem scenarios is to simply buy and pair/join a few “known good” or “known great” dedicated Zigbee Router devices to your Zigbee network (meaning purposely made Zigbee repeater/extender products designed for only that use-case and no other purpose. Because if you place a few such dedicated Zigbee Router products in strategic locations/areas as dedicated Zigbee repeaters/extenders then they will kind of act like a network-backbone in your Zigbee network mesh and hopefully make up for the lack of not having loads of Zigbee Router devices everywhere.

  • Two “known gooddedicated Zigbee Router products are the “IKEA Tradfri Signal Repeater ” and “Aeotec Range Extender Zi ”, as both those are well tested and proven work very good out-of-the-box, (so only need to be paired to your Zigbee network).

  • Two "known great" dedicated Zigbee Router products are the semi-DIY solution of buying and using Sonoff ZBDongle-E (EFR32MG21-based) or the Sonoff ZBDongle-P (CC2652P-based) after flashing them with correct Zigbee Router firmware and then powering them via USB-chargers (just for power). That flashing process is simpler than you might think and both of those are proven to work as awesome stand-alone Zigbee signal repeaters/extenders.

I can personally recommend buying those above specific devices for that purpose and placed spread out in your home (suggest adding at least three even in a small home):

Please read my while original guide post and try to understand that because Zigbee has such poor radio propagation in an indoor environment (which translate to very short signal range when passing signals point-to-point through building materials in walls/floors/ceiling or furniture as obstacles), as such it will usually not be enough to only have Zigbee Router devices “to cover for 1 or 2 router losses” like you say as your Zigbee Router devices on one side of your home will not be able to cover for losses on the other side of your home.So I believe that if you think more about it then you can figure that out yourself as should be obvious that redundancy and possible fail-over scenarios needs to be considered for each individual Zigbee device.

Anyway, basic calculations are also explained in both in Zigbee2MQTT’s FAQ (and somewhat better in the ZHA documentation), but those calculations do not consider the Zigbee radio propagation:

However no home is the same, so suggest you just try unplugging a few of your Zigbee Router devices (as in power-off multiple Zigbee Routes in the same area) to at least simulate a power outage of a blowned fuse (as that should kill all devices on the same electrical phase/circuit), then wait to test what happens, (personally I would try to test all possible scenarios to at least test killing all fuses/phases). I think it is much more likely scenario that a fuse blows then more than one Zigbee Router dies on its own.

Actually see that it is explained in Zigbee2MQTT’s FAQ here:

"Why are some links missing from my networkmap? : No worry, in case it happens with end devices (battery powered) it most of the times does not mean the devices aren’t connected to the network map anymore. Some end devices (e.g. Xiaomi door sensor) sleep for a too long time which causes the parent (router child ageing) to remove it from it from its child table. This is what causes the missing link. Even while its not in the child table anymore, the end device can still communicate via the router. This does not always happen since not all routers use child ageing (this is a Zigbee 3.0 feature)."

You can do what you like, but please understand and try to respect that this is not the right place to ask Zigbee2MQTT-specific questions, so you should still refer to Zigbee2MQTT’s own community for Zigbee2MQTT-specific questions and answers, see:

PS: Keep in mind that this “Zigbee” subsection in Home Assistant’s community forum is primarly meant to be about Home Assistant’s native ZHA integration (which is Home Assistant’s built-in Zigbee gateway) and Zigbee devices that can be used with it, and not about third-party Zigbee gateways, regardless if those third-party Zigbee gateways are software applikcations like Zigbee2MQTT, deCONZ/Phoscon, and Z-Way, or third-party hardware appliance Zigbee gateways like Philips Hue Bridge, Samsung SmartThings, IKEA Trandfri Gateway, etc.

Hello, new to using HA, just getting started with HA on RP5 with Sonoff Zigbee 3.0 USB dongle. I also plan to have a Broadlink RM4 pro hub for all my RF devices like curtains, fans etc. While I understand from reading this forum that Zigbee dongle is very sensitive to intereference from Wifi and it is preferred to connect it to RP5 via shielded USB cable, what about the RF hubs like Broadlink that has 315 and 433 MHZ signals. Does this hub need to be far away from the dongle too ? Thanks !!

Best practice is to always get the Zigbee Coordinator radio adapter away from all electronic appliances (including their power-supplies and cables/wires to them or anything else with eletricity) which by definition of course also include all smart home hubs/bridges/gateways boxes regardless of which IoT protocol they are actually using.

Getting it farther away will help, however if you have a good Zigbee network mesh with loads of Zigbee Router devices then it is often enough to get the Zigbee Coordinator radio adapter a few feet (preferably at least 1-meter) or more from any electronic appliance, (as well as a little bit distance away from walls/ceiling/floors and other dense building materials that might also kill the signal due to poor radio propagation of Zigbee signals, and as such keeping line-of-sight in mind is best practice).

Zigbee operates at 2.4GHz == 2400MHz radio frequency range which is classified as UHF (Ultra high frequency) and all radio magnetic interference in that same frequency range that is close and have strong/powerful emissions will cause problems for all Zigbee devices (as well as cause problems for other low-power IoT devices including those using Thread/OpenThread and BLE (Bluetooth Low Energy) too, that all do their best to coexist using the same radio frequency range.

While there are some IR devices that might operate at the same frequencies more important is to known there are PIR motion sensors for alarms that also use radar for motion detection where some products/models actually can use 2.4GHz frequency ranges for their radars.

What is more well known for operating in same frequency range is Wi-Fi, and non-WiFi sources like wireless game-controllers, mobile/cell-phones, cordless-phones/intercoms, audio/video-transmitter, wireless speakers/subwoffer, wireless headset, analog audio systems, microwave ovens, radar, power-supplies, wireless keyboard/mouse, and even Bluetooth devices (though Bluetooth is relatively low-power so do normally not cause huge interference unless have a Bluetooth transmitter right next to Zigbee Coordinator or a Zigbee device).

Also USB 3.0 will cause interference if close (so yes all USB 3.x ports/cables/peripherals emit noise that will interfere with IoT devices that use the 2.4GHz frequency range ) which is why you should use a USB 2.0 port or a USB 2.0 hub or a shielded USB 2.0 extension cable then make sure to get your Zigbee Coordinator away from any USB 3.x ports/cables/peripherals.

Some additional well known sources are listed in this article here → Wi-Fi and Non Wi-Fi Interference | MetaGeek

2 Likes

Does anyone know if the ZBmicro make good repeaters or is it better to go for the Sonoff ZBDongle-P?

I’m in France and Ikea no longer sells the Tradfri Signal Repeater :disappointed_relieved:

Thanks !

If there really is only an 1-to-1 either-or choise then always better to go with a few Sonoff ZBDongle-E and Sonoff ZBDongle-P re-flashed with Zigbee Router firmware and used as dedicated Zigbee repeaters/extenders if you for looking for longer range or for some reason do not want to add loads of other Zigbee Router devices, which is otherwise is the best approach to a strong Zigbee network mesh.

That is, always try not to aim to add a few great Zigbee Router devices, instead try to aim to add loads and loads of good Zigbee Router devices. The more Zigbee Router devices you have the better.

If you mean the new SONOFF Micro Zigbee USB Smart Adaptor then it looks to be based on EFR32MG21 so I guess it could be a potentially good Zigbee Router if they using good antenna design, but it probably will never be as great as a Zigbee Router device with external antenna that was practically designed to be a dedicated Zigbee repeater as long as you use the right firmware.

By that assumption the new SONOFF ZBMINI Extreme Zigbee Smart Switch (ZBMINIR2 which requires Neutral Wire) also uses the same EFR32MG21 so it too will probably be a good Zigbee Router.

1 Like

Thank you very much for these tips !!
Indeed, I had read that a larger number of routers would be better than a few.
I’ve reconfigured my Philips Hue bulbs with Zigbee2MQTT to take advantage of their router function, I’ll see if that’s enough (my house isn’t very big :sweat_smile:).

And yes, I was talking about the new SONOFF Micro Zigbee USB Smart Adaptor

Unfortunately, equipment with a neutral conductor like the ZBMINIR2 won’t work for me, as I don’t have a neutral conductor behind the switches.

My ZHA network has generally been ok with the occasional device drop off and manual re pairing needed. Yesterday a few devices dropped off. Even after pairing again the devices stay offline. Logs show they are still registering state changes though e.g. door sensor opened, closed, door lock opened, locked. It’s not a specific brand or device type either as it impacts Tuya door sensors and also a Lockwood lock.

Any suggestions? I’ve tried Reconfigure without luck alongside re pairing

UPDATE: Ok so my issue was possibly front end related. I killed the Android app and restarted and the correct states are displaying.

You are still thinking “star topology” (with router in the centre and everything around connected to the router) and trying to minimise the number of routers. It looks as though you are extremely lucky to have an unusual situation with many devices in a small area and little interference; and so a minimum number of routers is working for you. That’s fine, and I am envious.

Like a regular wi-fi (also star topology) if a zigbee router dies, all the devices which connect directly to it are unavailable. In time I believe zigbee devices would look for the next best connection - but as you say, you have loaded all the nearby routers to maximum already.


Zigbee tends to be used in battery powered devices which conserve energy by using low power radio signals. Low power means (a) shorter range, (b) being more sensitive to electrical/radio frequency interference from many unseen sources (including electric motors and poor electrical connections which are sparking), and (c) signals struggle to pass through dense materials (like walls).
Naturally this requires devices to be closer to the routers (compared to Wi-fi) so that each is close enough to receive good signal … and reliability is our main goal.

The purpose of a mesh network is to improve reliability by providing multiple paths for a message to take across the network. The more redundancy (ie more routers), the better the mesh can achieve this reliability. A desirable side-effect of having many routers is to reduce the number of end devices connecting to any one router, reducing the impact of a router failure.

It looks as though your focus is on controlling many devices in a relatively small area. Your diagram shows the devices on the right with only 1 step to the coordinator, which will be much faster than those on the far left which may have 4 or 5 steps for any message to get to/from the coordinator.

My suggestions to take best advantage of the mesh topology :

  1. your coordinator (the router connected to your Home Assistant computer) should be at (or close to) the centre of the mesh connecting mainly to the other routers. If all devices are physically close this should get all devices down to 2 or 3 steps from the coordinator and give more consistent response time.
  2. instead of adding 1 or two extra routers, consider adding another 6 or even more.

Of course, in the “real world” we have other considerations, like layout of the building, location of power sources, and the ever-present cost.

3 Likes

Thanks Hedda for this post.
It seems to me that 80% of zigbee issues (and about 50% of Wi-fi issues) come from people not realising that there can be a lot of interference in the 2.4GHz radio frequencies. We can’t see the radio signals or interference, so it is easy for people to assume that their network is the only network

1 Like

I’m seeing many and frequent disconnects very often lately. Have no clue how to troubleshoot this straight forward.

1x Sonoff ZBDongle-P as coordinator
CC1352P2_CC2652P_launchpad_coordinator_20220219

3x Sonoff ZBDongle-P as router
CC1352P2_CC2652P_launchpad_router_20220125

3x Sonoff ZBDongle-E as router
Z3RouterUSBDonlge_EZNet6.10.3_V1.0.0

Coordinator has a LQI to the P and E routers, but the return from the P and E routers are 0.

Very strange and never had strange behavior of my ZHA instance.

Device info Coordinator

CC2652
by Texas Instruments
Firmware: Z-Stack 20221226

This Coordinator is in the centre of the 3 layer home, USB 2.0 extension cable used.

Screenshot 2024-10-18 at 11.13.16

Help much appreciated.

You are using an older Zigbee Coordinator firmware for CC2652P so recommend that you upgrade that first:

See more info and links about Sonoff ZBDongle-P firmware in this other thread as off-topic here:

The firmware version on your Zigbee Router devices looks good so no need to update those.

1 Like

Thank you very much Hedda! Installed update, will report back in the feedback thread for fw 20240710. Cheers