Skip to content

Setup the cod.m ZigBee Coordinator (CZC-1.0) with zigbee2mqtt#

Please carry out the basic configuration according to the zigbee2mqtt documentation.

Files#

We are interested in the "Adapter settings", which can be found in the file data/configuration.yaml just like the basic configuration.

Tip

Lines beginning with # are comments in .yaml files and are ignored.

configuration.yaml (example)
# Home Assistant integration (MQTT discovery)
homeassistant: false

# allow new devices to join
permit_join: true

# MQTT settings
mqtt:
  # MQTT base topic for zigbee2mqtt MQTT messages
  base_topic: zigbee2mqtt
  # MQTT server URL
  server: 'mqtt://localhost'
  # MQTT server authentication, uncomment if required:
  # user: my_user
  # password: my_password

# Serial settings
serial:
  # Location of CC2531 USB sniffer
  port: /dev/ttyACM0

Configuration#

First, of course, stop zigbee2mqtt if it is still running. Change to the installation directory of zigbee2mqtt (/opt/zigbee2mqtt/) and edit the configuration file there with nano data/configuration.yaml.

Info

For .yaml files, it is essential to pay attention to the indentation (space at the beginning of the line).

IPV4#

Then configure the port under serial with tcp://xx.xx.xx.xx:6638. Of course, replace xx.xx.xx.xx with the corresponding IP address of the coordinator.

configurations.yaml (excerpt)
serial:
  port: tcp://xx.xx.xx.xx:6638

DNS#

As every local router typically also makes a host entry when DHCP is assigned, you can of course also use the host name of the local domain. This saves, for example, the DHCP address reservation or the assignment of a fixed IP.

configurations.yaml (excerpt)
1
2
3
4
5
6
serial:
  port: tcp://czc-XXXX.fritz.box:6638

# alternatively via zeroconf
serial:
  port: tcp://czc-XXXX.local:6638

Warning

Each cod.m ZigBee Coordinator has a unique host name. The XXXX is therefore different for each coordinator.

mDNS#

Alternatively, you can also address the coordinator via mDNS:

configurations.yaml (excerpt)
serial:
  port: mdns://czc

Warning

When using mDNS, each coordinator presents itself with the same name. If you operate more than one coordinator in the same network, you should configure them manually. (See above)

When using mDNS you will find the following lines in the log when starting zigbee2mqtt:

Zigbee2MQTT:info  2024-04-12 12:05:32: Starting mdns discovery for coordinator: czc
Zigbee2MQTT:info  2024-04-12 12:05:32: Coordinator Ip: 192.168.xx.xx
Zigbee2MQTT:info  2024-04-12 12:05:32: Coordinator Port: 6638
Zigbee2MQTT:info  2024-04-12 12:05:32: Coordinator Radio: zstack
Zigbee2MQTT:info  2024-04-12 12:05:32: Coordinator Baud: 115200

Conclusion#

A finished configuration.yaml could look like this:

configuration.yaml (example)
1
2
3
4
5
6
7
8
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://localhost
frontend: true
serial:
  port: tcp://192.168.0.42:6638

Save the file with CTRL-x, then y and then with Enter and start zigbee2mqtt.

When starting, you can check in the log that the ZigBee Coordinator has been successfully connected using the line Coordinator firmware version. The first start can take some time, be patient.

Example output zigbee2mqtt start
Zigbee2MQTT:info 2024-04-10 13:44:56: Logging to console and directory: '/opt/zigbee2mqtt/data/log/2024-04-10.13-44-56' filename: log.txt
Zigbee2MQTT:info 2024-04-10 13:44:56: Starting Zigbee2MQTT version 1.36.1 (commit #ffc2ff1d)
Zigbee2MQTT:info 2024-04-10 13:44:56: Starting zigbee-herdsman (0.40.3)
Zigbee2MQTT:info 2024-04-10 13:44:59: zigbee-herdsman started (resumed)
Zigbee2MQTT:info 2024-04-10 13:44:59: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20230507,"transportrev":2},"type":"zStack3x0"}'
...