ZHA UI options to perform Zigbee energy scan and change Zigbee network channel?

Request developers of Home Assistant ZHA integration add some UI options to ZHA (Zigbee Home Automation) integration for performing Zigbee energy scan and cthe hanging Zigbee network channel.

https://github.com/zigpy/zigpy-cli/blob/dev/README.md#performing-an-energy-scan

https://github.com/zigpy/zigpy-cli/blob/dev/README.md#changing-the-network-channel

Both actions can today be achieved via zigpy-cli in combination with zha-toolkit custom component

https://github.com/mdeweerd/zha-toolkit

The reason why you want to do so is to first check which Zigbee network channel is the least busy/noisy and then change/switch Zigbee network channel if not already on the most optimal channel for you:

https://www.home-assistant.io/integrations/zha#defining-zigbee-channel-to-use

To keep the options in GUI simple perhaps only give offer a choice of Zigbee network channels 15, 20, and 25 in the UI (which practically all Zigbee devices support) in order to avoid interoperability issues?

https://support.metageek.com/hc/en-us/articles/203845040-ZigBee-and-WiFi-Coexistence

Regardless if give the option to choose any channel or only select between a few in the UI this feature would need a warning and explanation of what the feature does. Suggestion with example of warnings:

WARNING!

Do not change Zigbee network channel unless you have already performed a Zigbee energy scan and looked at what Wi-Fi channel your WiFi router/access-points are using, (note that the numbering of Zigbee network channels and Wi-Fi channels do not match so you need to look up the frequency uses in order to tell what channels overlap).

After you change the Zigbee network channel it can take a while, up to a few hours or more, before devices will reconnect. If you want to speed up the reconnecting process you can power-cycle your devices, however, the best is to wait to do so with battery-operated devices until your mains-powered devices have connected. If some devices do not reconnect then you will need to manually re-join/re-pair them, but you should never have to remove the device from the ZHA integration.

By the way, I believe this pull request should add the needed backend code for Home Assistant core:

@Hedda, did you ever get any traction with this? I’ve been trying to build a tool with my spectrum analyzer but it’s a bit more work than I was hoping for. This tool is close, but wasn’t able to get it working right away (probably just need to learn more about getting zigpy-cli installed).

@frankenberrypi FYI, puddly who is one of the lead developers of zha and zigpy is working in adding a new “Advanced energy scan” feature/function to zigpy-cli (command line interface for zigpy radios used by zha) as well as “implement a standard interface for network scanning” for zigpy. Maybe you could look into creating and contributing a nice user frontend interface for that new as part of the UI for the ZHA integration to make it more accessible to all ZHA users? See:

and

Also see related development discussion here:

As well as these for Silicon Labs EmberZNet EZSP and Texas Instruments Z-Stack ZNP zigpy radios respectively:

Let me know what problems you’re having and I may me able to help.

~B