Has my large 160 device ZHA ZigBee network just stabilised? šŸ¤ž

Hi all

Thought I’d share in the hopes it helps others in some way.

I have a large ZigBee network spread throughout a two storey house and into the garden. It comprises of
67x mains powered devices
93x battery powered devices.

Before yesterday I would be constantly having to fix dropped ZigBee devices daily by either power cycling (remove battery or toggle mains power) or triggering a reset and pairing cycle with impacted devices. My daily tasks at least twice a day was to monitor and fix ZigBee devices as 5-10 were always offline unless fixed. I did this as my family relies heavily on sensor lights, etc. and I wanted to keep my family approval factor going to keep this hobby going :grin:.

Yesterday I decommissioned a few devices and since then my network seems to have improved (touch wood).
Devices removed were:
Xiaomi temperature and humidity sensor
Sonoff PIR sensor snzb03
Dlink PIR sensor

I replaced the PIRs with cheap Tuya 4in1 presence sensors and perhaps the reduction in end devices has helped or better protocol compliance? Anyway I’ll keep monitoring and report back on stability.

For reference, this is a summary of my network (note I used AI to create a template sensor and the device types aren’t perfect but good enough. Many leak sensors are actually garden moisture temperature humidity sensors and some switches are dedicated router dongles).

```
| Type          | Manufacturer             | Model                           | Power   | Role       | Qty |
| ------------- | ------------------------ | ------------------------------- | ------- | ---------- | --- |
| Button        | Philips                  | RWL021                          | Battery | End Device | 2   |
| Button        | eWeLink                  | WB01                            | Battery | End Device | 1   |
| Button        | LUMI                     | lumi.sensor_ht                  | Battery | End Device | 1   |
| Button        | LUMI                     | lumi.weather                    | Battery | End Device | 2   |
| Button        | LUMI                     | lumi.sensor_switch              | Battery | End Device | 3   |
| Button        | IKEA of Sweden           | TRADFRI on/off switch           | Battery | End Device | 1   |
| Button        | XIAOMI                   | lumi.sen_ill.mgl01              | Battery | End Device | 1   |
| Button        | TexasInstruments         | ti.router                       | Mains   | Router     | 6   |
| Button        | Zbeacon                  | TH01                            | Battery | End Device | 4   |
| Button        | IKEA of Sweden           | SOMRIG shortcut button          | Battery | End Device | 1   |
| Button        | easyiot.tech             | UT-02                           | Mains   | Router     | 1   |
| Button        | IKEA of Sweden           | RODRET Dimmer                   | Battery | End Device | 3   |
| Button        | easyiot                  | ZB-GW04-1v2                     | Mains   | Router     | 1   |
| Button        | LUMI                     | lumi.sensor_switch.aq2          | Battery | End Device | 1   |
| Button        | _TZ3000_abci1hiu         | TS0044                          | Battery | End Device | 1   |
| Button        | _TZ3000_mrpevh8p         | TS0041                          | Battery | End Device | 1   |
| Door Sensor   | Samjin                   | multi                           | Battery | End Device | 8   |
| Door Sensor   | eWeLink                  | DS01                            | Battery | End Device | 1   |
| Door Sensor   | LUMI                     | lumi.sensor_magnet              | Battery | End Device | 3   |
| Door Sensor   | _TZ3000_bpkijo14         | TS0203                          | Battery | End Device | 1   |
| Door Sensor   | _TZ3000_6zvw8ham         | TS0203                          | Battery | End Device | 2   |
| Door Sensor   | eWeLink                  | SNZB-04                         | Battery | End Device | 1   |
| Door Sensor   | HOBEIAN                  | ZG-102Z                         | Battery | End Device | 3   |
| Door Sensor   | Zbeacon                  | TS0203                          | Battery | End Device | 1   |
| Leak Sensor   | _TZ3000_upgcbody         | TS0207                          | Battery | End Device | 1   |
| Leak Sensor   | _TZE200_npj9bug3         | TS0601                          | Battery | End Device | 2   |
| Leak Sensor   | HOBEIAN                  | ZG-303Z                         | Battery | End Device | 13  |
| Leak Sensor   | HOBEIAN                  | ZG-222Z                         | Battery | End Device | 3   |
| Leak Sensor   | Zbeacon                  | SNZB-05P                        | Battery | End Device | 2   |
| Light         | LDS                      | ZBT-DIMLight-GLS0044            | Mains   | Router     | 4   |
| Light         | GLEDOPTO                 | GL-S-005Z                       | Mains   | Router     | 2   |
| Light         | IKEA of Sweden           | TRADFRI bulb E27 WW 806lm       | Mains   | Router     | 3   |
| Light         | _TZ3000_cfnprab5         | TS011F                          | Mains   | Router     | 1   |
| Light         | Philips                  | LWA001                          | Mains   | Router     | 6   |
| Light         | _TZ3210_95txyzbx         | TS0503B                         | Mains   | Router     | 1   |
| Light         | Signify Netherlands B.V. | LWA009                          | Mains   | Router     | 2   |
| Light         | _TZ3210_mja6r5ix         | TS0505B                         | Mains   | Router     | 5   |
| Light         | eWeLink                  | CK-BL702-AL-01(7009_Z102LG03-1) | Mains   | Router     | 10  |
| Light         | zbeacon                  | TS0505                          | Mains   | Router     | 3   |
| Light         | SONOFF                   | DONGLE-E_R                      | Mains   | Router     | 3   |
| Light         | _TZ3210_r5afgmkl         | TS0505B                         | Mains   | Router     | 3   |
| Light         | _TZ3210_amleyeej         | TS0501B                         | Mains   | Router     | 3   |
| Light         | _TZ3210_4zinq6io         | TS0501B                         | Mains   | Router     | 1   |
| Light         | HOBEIAN                  | ZG-229Z                         | Battery | End Device | 1   |
| Light         | Signify Netherlands B.V. | LTV003                          | Mains   | Router     | 1   |
| Light         | Zbeacon                  | TS0505B                         | Mains   | Router     | 3   |
| Light         | Philips                  | LWB010                          | Mains   | Router     | 1   |
| Light         | eWeLink                  | Z102LG03-1                      | Mains   | Router     | 1   |
| Light         | LUMI                     | lumi.plug                       | Mains   | Router     | 1   |
| Light         | SONOFF                   | Dongle-M                        | Mains   | Router     | 1   |
| Lock          | Yale                     | YDD-D4F0 TSDB                   | Battery | End Device | 3   |
| Motion Sensor | D-Link                   | DCH-B122                        | Battery | End Device | 3   |
| Motion Sensor | TUYATEC-zn9wyqtr         | RH3040                          | Battery | End Device | 2   |
| Motion Sensor | Samjin                   | motion                          | Battery | End Device | 3   |
| Motion Sensor | _TZ3000_c8ozah8n         | TS0202                          | Battery | End Device | 1   |
| Motion Sensor | _TZ3000_uw3dadam         | TS0202                          | Battery | End Device | 1   |
| Motion Sensor | _TZ3000_o4mkahkc         | TS0202                          | Battery | End Device | 1   |
| Motion Sensor | _TZ3040_o4mkahkc         | TS0202                          | Battery | End Device | 2   |
| Motion Sensor | _TZ3000_lf56vpxj         | TS0202                          | Battery | End Device | 1   |
| Motion Sensor | _TZE284_gnpflcoq         | TS0601                          | Battery | End Device | 4   |
| Other         | _TZ3000_kkahwiyu         | TS0043                          | Battery | End Device | 1   |
| Siren         | _TZ3000_c2yscrj8         | TS0224                          | Mains   | Router     | 1   |
| Smoke Sensor  | _TZE284_n4ttsck2         | TS0601                          | Battery | End Device | 2   |
| Smoke Sensor  | _TZE284_rccxox8p         | TS0601                          | Mains   | Router     | 1   |
| Switch        | HOBEIAN                  | ZG-204ZV                        | Battery | End Device | 4   |
| Switch        | eWeLink                  | SA-003-Zigbee                   | Mains   | Router     | 2   |
| Switch        | _TZ3000_kz1anoi8         | TS0049                          | Battery | End Device | 1   |
```

Totals: 160 devices | 67 Routers | 93 End Devices

Not that I am sure that this is your issue, but some time ago I had this problem with my Zwave network. Then I replaced my Yellow Box (on a RPi 4) with a Mini PC and then the issue was resolved. It seemed that the Yellow Box did not have the capacity for my large Zwave network. As you removed some devices, it may be an issue of capacity of whatever box you use. Just an idea…

One thing that I’ve found is to try and have a repeating device for every 4 to 5 end devices. You have far greater than that ratio if you just count routing devices, although some are way better than others. Some powered repeating devices have a very small limit on child devices (ikea plugs for instance, its somewhere around 6) or they don’t handle ā€œnewā€ children in a sane matter, kicking previously managed devices out, sending them on a search for a new parent. Bulbs are can be bad about this, especially off brands. I also find that the Tuya devices vary in ā€œqualityā€ since often they work better under a Tuya hub and I wouldn’t count them as a solid routing device. Seeing all those _TZ devices I’m not surprised you had a unstable mesh. I know a lot of people have good luck with Tuya but personally I haven’t found them to be worth gambling on.

The little USB Zigbee repeaters like this (non tuya version) have worked great for me across SmartThings, Hubitat and ZHA implementations. They seem to handle 12-16 child devices with ease and are small and discrete.


https://www.aliexpress.us/item/3256812332901196.html

Just my 2c!

I spoke too soon! A couple of devices started to drop off :worried:.

I have 16 dedicated routers on my network in addition to the Sonoff Dongle Max as my coordinator via USB.
Let’s see if it stabilises. I’ll look to see if there’s some more devices I can thin out from my network.

I assume it is the case, but Zigbee coordinator is on 1 0r 2 mtr USB extension cable (to prevent USB interference)?
Another option to avoid interference would be a SLZB over ethernet…I use one with POE, no issues

If it would help you, I had developed this tool to help me see what my ZHA mesh was actually doing, I went ahead and uploaded it to Github as a HACS dashboard repo, or you can install it manually.

It shows an expandable summary of all your routing devices, their neighbor and router tables, and more.

LMK if you get it installed and it works for you!

I just installed this (manual install).

Love it, thanks!!

Awesome, glad it helped! If you don’t mind, share some of your routing details, I’m curious how it looks on other systems.

Part of my network is unstable as well; I narrowed it down to a tradfri ledstrip. All devices connected via the Trader loose connection after a while. In your case, try to make some snapshots of the Zigbee network and see if there are common devices/routers responsible when a device drops off the network.

Here are first few lines of mine. I do have one suggestion, and that is to add the ability to sort by tapping/clicking on the column headings.

Added sorted columns, plus some other polish and fixes. v1.3 is up on the repo.

LMK any other thoughts or suggestions!

Obviously I have done something wrong but I do not know what.
I think that I have successfully added the card but don’t see it when I try to add it to my Dashboard:

After adding the repo, install it by searching for the name in HACS, then add it by clicking the row:


then click INSTALL at the bottom.

I updated the README in the repo to hopefully make it more clear.

That did. Thanks !!!

Thanks for sharing. I have been using dan-danache/ha-zigbee-map: Real-time visualization of your Zigbee mesh network - Codeberg.org but visualisation of 160 devices in a mesh topology is a pretty map of busy lines even though I did overlay on my floorplan.
I’ll take a look at your work and see if it helps.

The last update broke the placement of all my devices and I haven’t set aside time to redo them yet.

But here’s what my network mesh looks like

And a simpler view of just my dedicated routers

Let me know if there is any information that might help debug your situation or some workflow I can add.

Have you reviewed the ā€˜Console’ log after you run a mapping in @dandanache Zigbee Map ? Look for any of the ā€˜Anomaly detected’ entries and go thru and remove and re add (one at a time) each device that shows that they are retaining any orphaned devices. It may take you several evolutions of this to find these, over several days. Cleaning out these seems to significantly, however not completely, improve the occurrence of devices that drop off for a period of time and then return. However, still not a complete fix for latency of devices responding to commands. It is interesting and frustrating that a Zigbee device will retain the address (for what purpose I do not know) of another device that is removed from the network, basically forever (until you ā€˜clean’ the ā€˜retaining’ device by removing and re-adding). Seems a real design flaw in Zigbee networking.

I will qualify my point, I do not see you stating whether you are using ZHA or Zigbee2MQTT. I am using Zigbee2MQTT, so I do not know if @dandanache 's utility generates this diagnostics message for ZHA.

Good hunting!

07:57:57.089 [ WARN ] Anomaly detected: Master Bed Room Closet Light reported a neighbor that is not part of the network # 0xa4c13825ebb5a185 -- who dis?

I’m using ZHA. I did try to fix some of the orphans but despite removing from Home Assistant, starting paring mode and readding, it still doesn’t fix them as far as I can tell. AI suggests that the firmware of the devices is buggy and it can persist old data.
I’ve also had instances where a device is centimetres away from a dedicated router dongle and despite force pairing from the dongle, the device still chooses to pair from another router.

So part of me has actually given up on removing devices and pairing them again as it doesn’t seem to work despite the theory.

I feel like I have a very router heavy network with short distances to end devices but it’s always a cat and mouse game.

@dproffer in your experience, when you remove the device and then pair it again, does the anomaly disappear? I might give this a go anyway but I’m wondering if there is immediate proof that it has worked.