Zigbee Energy Scan

I often read about performing an energy scan to see what zigbee channel to use if experiencing interference or high channel usage. However I am wondering what is the best way to perform the scan and how to interpret the data.

My production system is on ch25 in this first scan:

Based on the above scan, it would appear that ch20 is a perfect choice given it is at 5.83%, while ch25 is at 88.05%. However, here is where I have a doubt. If all your zigbee devices are on ch25, then it is normal for the energy scan to return a high value… and why is it therefore considered bad?

Anyhow, I moved to ch20 and from my test system I performed another energy scan. Now we see that ch20 is at ~50% (different location and coordinator).

Now we see that ch25 has dropped to ~14% (see disclaimer above) which is still higher than ch20 was but low enough to be a good choice. I actually prefer ch25 as on WIFI ch6 can interfere (likely highest power output) if the channel is set wide enough. I keep my 2.4GHz WIFI channels strictly to 20MHz as there are no performance devices on my 2.4GHz SSID.

I guess my point is that the energy scan makes most sense when you are starting from zero, with no installed zigbee devices. Once you have an active network, how is judging the channel you are using useful given the energy scan is likely showing lots of usage due to your own devices?

Note: If you are comparing the two scans above, please note they were performed by a SiLabs based controller (above) and a TI based controller (below) and they are in two different rooms with two significantly different antennas. The change is visible, however the measurements may not be comparable due to differences between the two coordinator setups.

I have a really cheap spectrum analyzer (TinySA Ultra) that I am still learning on how to use, but this is what the spectrum looks like for zigbee ch20 to ch25:


Red is max hold, yellow is decay hold.

My goal is to hunt for interference sources but not sure yet on the best way. Suggestions welcome!

The energy scan in ZHA/zigpy is just a real-time snapshot of the specific time it is taken and thus a single energy scan is not so good, it should only be used as an indication.

Regardless, before you do a a such energy scan or any troubleshooting at all you should read and try to follow these best practice tips to take actions in order to avoid common pitfalls:

@Hedda - I am 10 years into using Zigbee and have learned a lot from your threads in the past, so I have already covered all you list in the other thread (likely reading your threads!). I am currently also testing a USB isolator in line with the coordinator but it doesn’t seem to be helping. What has helped, or at least it seems so for now as I only just made the changes, is replacing older 2017/2018 Jasco outlets and switches as they seem to be quite troublesome especially when there are storms and power outages. If they don’t break (well known bad cap issue), they seem to break the mesh in their near vicinity. I am in the process of replacing them all with other products and things are getting better.

My post above was just to get more feedback on the energy scan’s use cases. I think many people may be drawing incorrect conclusions from it such as “my channel is bad” when in reality they are seeing their own traffic.

Yes indeed. I think that the zigpy energy scan was originally never intended to be exposed in the ZHA UI. It was instead meant only to be used for the ZHA config flow to automatically try to pick the best channel when initially creating a new Zigbee network on first installation, as well as be used for diagnostics analysing by ZHA developers when people repost issues.

It should probably be hidden in the ZHA UI and only included in diagnostics as well as be accessable from the CLI, as this is also what most propriatory Zigbee gateways/hibs/bridges from commercial companies do. They almost never allow the user to see information that do not really help them and is more likley to confuse them. It should preferably just work automagically.

image

1 Like

What @Hedda is trying to say is: look closely at your before and after screenshots. You really need to take an average of the readings instead of relying on a single snapshot at a moment in time.

Examples:
Channel 14 went from 20% to 52%
Channels 16-18 went from 80’s% to 30’s%

None of the above should be related to your zigbee channel switch, yet there’s massive variances in at least 4 channels (I stopped checking after those, so there may be more).

Take a few readings at various times across the span of a week, then average out the values - you might find that the change in channel isn’t really required unless you’re encountering lag.

I believe the scan is already performing an average, however I did mention that the two scans were performed in different rooms, with different coordinators (both Sonoff but one uses a TI chip and the other a SiLabs chip) so the numbers should not be compared directly. Regardless, the spectrum is very dynamic so yes, comparing is card given it is just a snapshot in time. I purchased a TinySA Ultra (cheap spectrum analyzer) to get a bitter glimpse at what is actually happening given that interference can come from many sources. I hope I’ll be able to sniff them out… we’ll see.

1 Like

Case and point… ch20 had 5% usage yesterday and ZHA is now warning me it is at 97% along with what I can do to fix it:

I believe this warning is misleading and has little to no purpose being shown to users unless I am missing something fundamental…

Again, that is only a instant snapshot in time as it just does a average from a few seconds, so it is not like it shows an average of hours or even 1-minute, and yes that is probably not helpful for any one purpose that helping a new user automatically choose a channon uppn initial install

Although the TinySA Ultra is far from a professional spectrum analyzer, I had some fun with it investigating the noise floor of Zigbee ch20 and 25 at my home. In the screen capture below you can see that ch25 is pretty good with no significant activity or noise. The yellow trace is instantaneous, while the red trace is a hold of the max signal. Both images are centered on ch25 (2.475 GHz).

About 20 minutes after moving my Zigbee network from ch20 to ch25. Here you can clearly see the Zigbee mesh network in action by looking at the red trace.

This is a way more useful method to scan for activity on a certain channel.

As for ch20 it was the same but in reverse. In other words, all the “noise” was just Zigbee activity, and once I moved the mesh to ch25, it went quiet. I moved it anyway as I use all 3 main Wifi channels 1, 6, and 11 so moving to ZB ch25 puts me beyond ch11 instead of in the middle of W ch6 and ch11 (more chances of interference from both channels).