ZHA Zigbee change channel

Can you post the exact command line to form the network?

This is the command that I used, for channel 19:

bellows -d /dev/ttyUSB0 form -c 19

I should note too that this will require you pair your devices again.


You seem to be implying that if one executes the command bellows -d /dev/ttyUSB0 form -c 19 from then on, every time you restart Home Assistant the Zigbee network will remain on channel 19. Is this correct?

I seems that this should be a parameter passed in every time the form network command is executed which I would have thought would be in some startup code somewhere. How does the Zigbee network get created when the machine is powerd on? When is the ‘form network’ command issued? I certainly did not not manually do this the first time?

Is there a way to see what network the Nortek HUSBZB-1 is running on at present?


Yeah, it should probably be a parameter somehow, I suppose. Or maybe the first time it is configured it somehow asks you what channel you want. It’s possible the HUSBZB-1 comes with a formed network when it’s purchased? I don’t know. I haven’t looked at the code, but I suppose if there is no formed network then Bellows will form one itself.

# bellows -d /dev/ttyUSB0 info
[<EmberNetworkStatus.JOINED_NETWORK: 2>]
[<EmberStatus.SUCCESS: 0>, <EmberNodeType.COORDINATOR: 1>, <EmberNetworkParameters extendedPanId=[15, 60, 4, 36, 250, 136, 196, 186] panId=19604 radioTxPower=8 radioChannel=19 joinMethod=EmberJoinMethod.USE_MAC_ASSOCIATION nwkManagerId=0 nwkUpdateId=0 channels=134215680>]

1 Like

Thanks for all the info. I tried executing the bellows command but it timed out ad gave me a string of errors…

bash-5.0# bellows -d /dev/zigbee info
Traceback (most recent call last):
  File "/usr/local/bin/bellows", line 10, in <module>
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/bellows/cli/util.py", line 40, in inner
    loop.run_until_complete(f(*args, **kwargs))
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.7/site-packages/bellows/cli/ncp.py", line 75, in info
    s = await util.setup(ctx.obj['device'], ctx.obj['baudrate'])
  File "/usr/local/lib/python3.7/site-packages/bellows/cli/util.py", line 107, in setup
    await s.reset()
  File "/usr/local/lib/python3.7/site-packages/bellows/ezsp.py", line 55, in reset
    await self._gw.reset()
  File "/usr/local/lib/python3.7/site-packages/bellows/uart.py", line 208, in reset
    return await asyncio.wait_for(self._reset_future, timeout=RESET_TIMEOUT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 449, in wait_for
    raise futures.TimeoutError()

I am running in Docker on a Raspberry Pi. I started a shell inside Docker and issued the command changing /dev/TTYUSB0 to /dev/zigbee since that is where my stick turns up. Do I need to stop Home Assistant before I can run the Bellows command? If so, how would I do that in a Docker container?

I really appreciate all the help here as I learn my way around. I have an Aqara temperature and humidity sensor that will not stay connected so I am hoping it is a network channel issue bashing into my WifFi or something else.

Yep, they both can’t (shouldn’t) talk to the USB stick at the same time.

I’m not sure the best way to do that. Probably the easiest is to just disable the ZHA component (in the YAML or whatever) while you’re using Bellows in the terminal.

In the ZHA Configuration panel, check the LQI (Link Quality Index) and RSSI (Received Signal Strength Indicator) values. LQI less than 255 indicates packet loss. RSSI should ideally be something like -75 dB or better (e.g. -75 is better than -85).

1 Like

FYI @IanAber - I’ve had mixed results with the Aqara temp & humidity sensors. Some of the devices will drop from my network even with low RSSI. And others with a high RSSI (-90) will remain connected with no problem. I’ve been playing with moving devices around to see the impact that makes.

Good news is that getting the device to rejoin the network isn’t too bad. Just adding a new ZHA entry in HA and clicking the side button on the device. All settings are retained.

I have two Aqara Zigbee temperature and humidity sensors. One of them is very stable on a SmarThings network. The other drops of after a few hours, currently set up on Home Assistant with a HUSBZB-1 hub. The one that keeps dropping was doing the same on the SmarThings network too so I am sure it is the sensor not the hub that is the problem.
I found the same as you where opening the network to new devices and pressing the button on the sensor gets it working again but this is hardly a realistic answer to the problem. I am looking for an alternative sensor as these things are too unreliable to be anything but toys.

1 Like

I do not see anything by way of LQI in the ZHA configuration panel. Am I looking in the right place?

select a device from the device menu, the link quality will show then.

you can also use this custom lovelace panel:

1 Like

I have been trying to change my Zigbee channel to 20 and when I enter the following

bellows -d /dev/ttyUSB1 form -c 20

I get an error that the bellows command isn’t found

Am I missing something?

I think you’re not inside your venv, just try something like this before:

sudo su - homeassistant
source /opt/homeassistant/bin/activate

Please remember that HASS should be stopped when running bellows commands.

Thank you,

I’ll give that a try. After I enter the 1st command and input my password I get the following error

No passwd entry for user ‘homeassistant’

Unfortunately (or fortunately) Home Assistant allows for multiple ways to install it. Depending on how it’s installed will change how you access that bellows command. Also, bellows only works with the EmberZNet devices, like the Elelabs mentioned in the first post.

For example, on my Hass.io I can use the following to access belows:

root@hassio# docker exec -it homeassistant /bin/bash
bash-5.0# bellows -d /dev/ttyUSB0 form -c 19

My Bad, I am using a HUSBZB-1 USB stick.

I just cannot seem to get a stable Zigbee netowork which is getting really frustrating. I am even considering going back to my Wink Hub2. I am having various different lights become unavailable on a daily basis.

1 Like

Your device also uses EmberZNet, so bellows will work with that too. This is the same device I use.

What I have found is that changing the Zigbee channel will help only a little. If I were you I would start small. Start from scratch, add a couple Zigbee devices, and then see how it works for a week. Then add a couple more.

The main issue I have found with Zigbee is that the Zigbee Alliance does not really do their due diligence with testing devices. So some devices are “certified” but really are bad actors. These devices can make the mesh network unreliable, causing other devices to seem flaky.

It’s hard to figure out which devices are causing the problems, that’s why I recommend adding a couple devices at a time. Be sure to periodically look at the various LQI and RSSI to see if the devices you have added are maintaining a strong connection.

Thank you for your help, I have around 28 zigbee lights, and 2 z-wave switches. I was using a Wink Hub 2 prior to switching over to HA and the HUSBZ1. I know the Wink Hub had it’s issues but I never had any lights go unavailable which makes me wonder if it is an issue with the HUSBZ1. I even tried adding a couple of zigbee plugs from Ikea to act as repeaters. I do check the LQI & RSSI and never see any issues.

I may try picking up a Conbee stick and giving that a try

I and probably many others are successfully using the HUSBZB-1. It’s possible that something in your configuration does not work with this particular coordinator device, but I think it’s unlikely.

Replacing things without determining if they are at fault is one possible way to fix your problem, but I don’t think this is the best approach. I would recommend systematically trying to determine what the problem is.

1 Like

I would definitely check your WiFi. I had a lot of issues, then my neighbour left (with his WiFi) and things started to work better :wink:
The problem with our USB stick is that it is very vulnerable to WiFi interference. I improved reliability putting a CC2530 repeater right next to it. Beware of power sockets (as repeaters) as they sometime go to sleep and disrupt your network (I had issues with Xiaomi ones)

Here is a screenshot of my WiFi analyzer. I have 2 networks in my house on channel 1 & 11. Channel 1 is for my 4 WiFi security cameras. As you can see channel 6 is wide open which is why I was hoping to move my Zigbee channel up to 20