ZHA Zigbee change channel

Well, that’s what @rpress wrote. I’ve never tried that. I suspect there must be something in the zigbee.db, but I inspected it many times without finding anything about channels…
As a last resort, if nothing is working on the main computer, just copy the zigbee.db from the other laptop :wink:

Thank you,

I have some time today so I’ll give it a go. The worst that can happen is I’ll have to reset my ZigBee devices.

Ok after some trial & error I was able to change the Zigbee channel using the following

bellows -d /dev/ttyUSB1 form -D /config/zigbee.db -c 24

I can also confirm that when I moved the HUSBZB-1 back to my main HA machine none of the zigbee devices worked so the channel change must also be written too the HUSBZB-1

Thanx for sharing. It was a one-year-old question, after all :wink:

Has anyone successfully done this in HASSIO on a raspberry pi? I’ve removed my ZHA integration (I actually deleted all devices first), ssh-d in and run the docker command to get to bash. Then run the bellows command from bash but I still get the timeout error. If I stop Homeassitant, I can’t get to bash to execute the bellows command…

@tcork Did you restart your home assistant after disabling zha? Disabling zha SHOULD stop the library from starting.

You could also just stop HASSIO but leave the container up by either:

clicking “stop” under configuration --> server controls

or, if that doesn’t work, inside your container, run

hassio homeassistant stop

then try again.

Thanks @sreknob I did eventually sort this! For those that come up against this with an elelabs USB I also had to set -b 115200 to force the baudrate (the same as setting it up in config.yaml). When using that I was able to change channel no problem.

1 Like

Can I get some help please? I have an XBee 3. I plugged it into the RPI 4, added ZHA and was able to setup devices. Problem is, I dont know what the channel is and I would probably want to change the channel to. When I run the command above (bellows -d /dev/ttyUSB0 info), I get the following error:

bash-5.0# bellows -d /dev/ttyUSB0 info
Traceback (most recent call last):
  File "/usr/local/bin/bellows", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
bash-5.0# bellows -d /dev/ttyUSB0 info
Traceback (most recent call last):
  File "/usr/local/bin/bellows", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/bellows/cli/util.py", line 38, in inner
    loop.run_until_complete(f(*args, **kwargs))
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.7/site-packages/bellows/cli/ncp.py", line 66, 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 115, in setup
    await s.reset()
  File "/usr/local/lib/python3.7/site-packages/bellows/ezsp.py", line 84, in reset
    await self._gw.reset()
  File "/usr/local/lib/python3.7/site-packages/bellows/uart.py", line 221, 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()
concurrent.futures._base.TimeoutError

Ive tried each of the devices listed in Hardware:

I have got to bash shell via Portainer - containers, homeassistant, exec console. I cant seem to access a bash shell via SSH (I can open an SSH session on port 22 and port 22222 but cant get anywhere form there)

Default channel is 15, you probably don’t need to change it…
It appears you are likely trying to run bellows command while HA is using the radio. Please make sure home assistant is not using the radio at the same time. See the earlier posts in this thread.

1 Like

I’m using zha with a conbee 2 and would like to change the channel. Is it still set to 15?

Ok so now we can change the channel using this configuration:

zha:
  zigpy_config:
    network:
      channel: 25
6 Likes

Great news!
Can you state here the min HA version this was added?

Thank you.

HA 0.115.2 if you use a Phoscon/deconz device (conbee or raspbee)
Don’t know for other stick but it was added earlier

Does not work on Sonoff Zigbee bridge. Stuck on channel 11.

Where did you see that’s channel 11? By default it is channel 15

What if you try with:

zha:
  zigpy_config:
    network:
      channels: [25]

What happens if I change the channel on an already build network?
Do I have to manually reset all my devices?

I did try to change and after reboot all my devices remain connected, does that mean they are on the new channel now?

Thanks,

Unfortunately, you can’t. Bellows does not currently support channels. You need to start over in order to change channels. I am wrapping up a similar move of 200+ devices right now. It’s unfortunate that such a basic feature common on other platforms is missing, but it is what it is.

That’s unfortunate.
So in order to do that I need to remove the integration and add it again ?

BTW, Which channel are you switching to?

My thoughts are to the edge of the band, IE - channel 25.

1 Like

what is the easiest way to find out the channel used by ZHA?
Normally during PAN creation the coordinator is supposed to scan band and select ‘best’ channel. Comments above mention that default chanel is 15? So no scan in ZHA integration?