How to change channel of Zigbee2Mqtt addon?

I am just starting to build myself a Zigbee2Mqtt net.

I am using a Sonoff Dongle Plus E and I just have 2 devices connected. A smart power strip and a Smart button.

Now that I kind of understand how the process goes, I want to start adding ZigBee routers (Sonoff Mini ZB) and for this, after searching and reading I decided that, since I am in Germany channel 25 is the best one to coexist with my Wifi (and neighbor’s wifi) network.

The Zigbee2Mqtt documentation says that I can define the Channel using

advanced:
  channel: 25

I have done that and restarted Zigbee2Mqtt but I see in the logs that the default channel (11) is still being used:

[09:06:04] INFO: Preparing to start...
[09:06:04] INFO: Socat not enabled
[09:06:05] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:debug 2023-02-26 09:06:07: Loaded state from file /config/zigbee2mqtt/state.json
Zigbee2MQTT:info  2023-02-26 09:06:07: Logging to console and directory: '/config/zigbee2mqtt/log/2023-02-26.09-06-07' filename: log.txt
Zigbee2MQTT:debug 2023-02-26 09:06:07: Removing old log directory '/config/zigbee2mqtt/log/2023-02-22.12-12-25'
Zigbee2MQTT:info  2023-02-26 09:06:07: Starting Zigbee2MQTT version 1.30.1 (commit #unknown)
Zigbee2MQTT:info  2023-02-26 09:06:07: Starting zigbee-herdsman (0.14.89)
Zigbee2MQTT:debug 2023-02-26 09:06:07: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/config/zigbee2mqtt/coordinator_backup.json","databaseBackupPath":"/config/zigbee2mqtt/database.db.backup","databasePath":"/config/zigbee2mqtt/database.db","network":{"channelList":[11],"extendedPanID":"HIDDEN","networkKey":"HIDDEN","panID":6754},"serialPort":{"adapter":"ezsp","path":"/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20221029100418-if00"}}'
Zigbee2MQTT:info  2023-02-26 09:06:11: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2023-02-26 09:06:11: Coordinator firmware version: '{"meta":{"maintrel":"3 ","majorrel":"6","minorrel":"10","product":8,"revision":"6.10.3.0 build 297"},"type":"EZSP v8"}'
Zigbee2MQTT:debug 2023-02-26 09:06:11: Zigbee network parameters: {"channel":11,"extendedPanID":221,"panID":6754}

My configuration file looks like this:

data_path: /config/zigbee2mqtt
socat:
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: false
mqtt:
  base_topic: zigbee2mqtt
  user: mqtt_user
  password: my-password-here
  server: mqtt://my-server-here:1883
serial:
  port: >-
    /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20221029100418-if00
  adapter: ezsp
advanced:
  channel: 25

Is there something more I need to do? what I am missing?

Thanks!

Also, something I just realized,

when going back from YAML edit to UI edit, the advanced option disappears

So looks like the addon configuration does not support changing the channel, I had to change it on config/zigbee2mqtt/configuration.yaml (Using ssh) and now it correctly changed!

1 Like

It can all so be set within the Z2M web interface.
Wile in the interface its under Settings/Advanced.

You are right. I was trying to do this on the add-on config, but I totally forgot about the Web-UI

On mine, I can change all those settings but it doesn’t work. The stick comes back to the original channel. I need to delete the backup settings, then unplug and re-plug the usb cable and then the zigbee channel changes.

I found that you need to do the following, as
Well as in the yaml file or setting / advanced fike

I changed the channel and the channel mask in the Coordinator_backup.json file, two lines (this was what was causing the dongle not to start. The channel mask doesn’t get updated even after a restart)

___“channel”: 25,
___“channel_mask”: [
25
],

Once the channel mask is the same as the channel all works

2 Likes

I thought I would ask my question here rather than start a similar thread.

I am setting up a Zigbee network and am considering WiFi interference. The 2.4Ghz spectrum looks like this…

My zigbee network is currently on the default 11. Would channel 25 be my best option please?

Once I change the channel, will the connected devices keep working or are further steps necessary?

With thanks.
Ed

Looks like it

Normally, channel change → re-pair

Thank you for the speedy reply. I’ve found restart under tools but I can’t find repair network anywhere. Can you please help?

You won’t find it, you need to go to each device and pair it again. Some adapt to the new channel, but those that don’t → re-pair.

Thats a ZWave concept not zigbee

Wow, ok. I’m glad I’m considering this before I added too many devices. Makes me think I need to be sure channel 25 is best if there’s a chance I’ll need to repair all devices in the future.

Is there any factors to consider when picking a channel other then WiFi spectrum analyser? I have a mesh system which will move channels based on the environment.

I have channel 25, but I keep my Wifi on channels 1 and 6.

My mesh router seems to be on channel 4 ATM making me think 25 is best too as it’s furthest away

Just double check your mesh Wifi network isn’t set up to automatically move to a different (less crowded) channel and you should be good for the future.

Also, once you do change the channel on Z2mqtt, give it some time before trying to re-pair devices. Some of them will move to a different channel, but not immediately (I believe it might be related to the reporting settings of each device). I’d give it 24 hours, if you can handle some devices potentially being unavailable for that long.

Unfortunately, it does exactly that. I cannot disable the auto-optimise “feature” or pick a channel. I guess I have to just make the best decision I can based on things today and keep my fingers crossed nothing changes.

I’ll change channel, wait 24 hours, then re-pair the ones that haven’t made the jump.

Thank you all

Ice changed channel to 25 via web GUI - after that i will not start :frowning:
Tried same by editing conf file - doesnt work

If I change back channel to 11 it starts

Any idea how to change this?
(I have overlaping WIFI networks so Id like to move to other range)

EDIT
I removed /config/zigbee2mqtt/coordinator_backup.json - then restarted MQT but still same - somehow it knows adapter (whatever it is) uses 11


2024-07-02 18:33:37] error:    zh:adapter:zstack:manager: Configuration is not consistent with adapter state/backup!
[2024-07-02 18:33:37] error:    zh:adapter:zstack:manager: - PAN ID: configured=6754, adapter=6754
[2024-07-02 18:33:37] error:    zh:adapter:zstack:manager: - Extended PAN ID: configured=00124b0024c2428f, adapter=00124b0024c2
428f
[2024-07-02 18:33:37] error:    zh:adapter:zstack:manager: - Network Key: configured=xxxxxxxxx, adapter=
01030507090a0b0c00020406080f0c0d
[2024-07-02 18:33:37] error:    zh:adapter:zstack:manager: - Channel List: configured=25, adapter=11
[2024-07-02 18:33:37] error:    zh:adapter:zstack:manager: Please update configuration to prevent further issues.
[2024-07-02 18:33:37] error:    zh:adapter:zstack:manager: If you wish to re-commission your network, please remove coordinator
 backup at /config/zigbee2mqtt/coordinator_backup.json.
[2024-07-02 18:33:37] error:    zh:adapter:zstack:manager: Re-commissioning your network will require re-pairing of all devices
!
[2024-07-02 18:33:37] error:    z2m: Error while starting zigbee-herdsman
[2024-07-02 18:33:37] error:    z2m: Failed to start zigbee
[2024-07-02 18:33:37] error:    z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for
 possible solutions
[2024-07-02 18:33:37] error:    z2m: Exiting...
[2024-07-02 18:33:37] error:    z2m: Error: startup failed - configuration-adapter mismatch - see logs above for more informati
on
    at ZnpAdapterManager.determineStrategy (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:223:35)
    at ZnpAdapterManager.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:57:26)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:129:29)
    at Zigbee.start (/app/lib/zigbee.ts:63:27)
    at Controller.start (/app/lib/controller.ts:139:27)
    at start (/app/index.js:154:5)

It’s (most probably) loading the old channel from the backup file, hence the mismatch error.

This github post tells you how to fix it, but make sure you take a backup of your backup in case something goes wrong.

Thanks. I edited this file as written there, also tried to delete this file - but nothing helped - still the same error, fails to start log - says:

 Channel List: configured=25, adapter=11