Because I’m having a hard time pairing devices with the Lidl gateway, I was looking at a way to change the default Zigbee channel the gateway is using (15).
It’s possible using the bellows
script, which I believe comes with Home Assistant. However, since I run HA from Docker I tried to see if it was possible using the serial gateway, which it was.
!!! WARNING !!!: changing the Zigbee channel is a destructive operation, it creates an entirely new Zigbee network and you need to re-pair all Zigbee devices.
Install requirements (I did all this on macOS, YMMV):
- create a Python 3 virtual environment:
python3 -mvenv bellows-venv
- activate it:
source ./bellows-venv/bin/activate
- install
bellows
:
pip install bellows
(using a virtual environment isn’t strictly necessary, but I would recommend it because it makes it really easy to discard any packages and executable once you’re done)
First, you need to tell the gateway to leave the current network:
bellows -d socket://192.168.1.123:8888 leave
(change the IP-address to your gateway’s IP address)
Next, you create a new network:
bellows -d socket://192.168.1.123:8888 form -D ./zigbee.db -c 22
(-c 22
sets the channel to 22)
I didn’t get any output from that command, so I Ctrl-C’d out of it.
To check which channel is being used, you can use this command:
bellows -d socket://192.168.1.123:8888 info
Output:
…
[<EmberStatus.SUCCESS: 0>, <EmberNodeType.COORDINATOR: 1>, EmberNetworkParameters(extendedPanId=XXX, panId=XXX, radioTxPower=8, radioChannel=22, joinMethod=<EmberJoinMethod.USE_MAC_ASSOCIATION: 0>, nwkManagerId=0x0000, nwkUpdateId=0, channels=<Channels.ALL_CHANNELS: 134215680>)]
…
I don’t know if the next steps are required, but I did them anyway.
- Copy the file
zigbee.db
, which was created by theform
command, to your Home Assistant root directory (the one containingconfiguration.yaml
). There’s probably already a file with the same name there, which you should overwrite (WARNING: if you have other ZHA integrations configured, you probably shouldn’t; I don’t know what the file contains specifically, so it may not be necessary to overwrite it) - Add the following to your HA configuration:
zha:
zigpy_config:
network:
channel: 22
FWIW, I’m still having pairing issues so it wasn’t resolved by changing the channel, but I thought I’d share this anyway