Replacing Zigbee adapter

I want to replace my Zigbee adapter (CC2531 to Sonoff P). Changed it in Gladys, but now the Zigbee2mqtt Interface URL is unreachable.

Tried changing back to the old adapter and changed the settings again. Then the Zigbee container wouldn’t start. Rebooted my Pi. Tried again. The container had started according to Gladys, but the Z2M site is still unreachable.

Found this error in the docker logs of gladys-z2m-zigbee2mqtt container:

Zigbee2MQTT:info  2024-04-24 20:41:27: Starting Zigbee2MQTT version 1.36.1 (commit #ffc2ff1)
Zigbee2MQTT:info  2024-04-24 20:41:27: Starting zigbee-herdsman (0.40.3)
Zigbee2MQTT:error 2024-04-24 20:41:28: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2024-04-24 20:41:28: Failed to start zigbee
Zigbee2MQTT:error 2024-04-24 20:41:28: Check for possible solutions
Zigbee2MQTT:error 2024-04-24 20:41:28: Exiting...
Zigbee2MQTT:error 2024-04-24 20:41:28: Error: Error: No such file or directory, cannot open null
Using '/app/data' as data directory

“null” is supposed to be the adapter, so maybe there is a sync problem?

Changed the adapter and the usb-ports in the settings makes the service stop it seems (at Services screen):
zigbee2mqtt (Internal name: zigbee2mqtt) -- Error

Can’t enable the Z2M anymore on the Z2M setup screen.

This is the output of the Gladys container log:

2024-04-24T23:32:41+0200 <info> init.js:39 (Zigbee2mqttManager.init) Zigbee2mqtt USB dongle attached to /dev/ttyUSB0
2024-04-24T23:32:41+0200 <info> checkForContainerUpdates.js:14 (Zigbee2mqttManager.checkForContainerUpdates) Checking for current installed versions and required updates...
2024-04-24T23:32:41+0200 <info> installMqttContainer.js:120 (Zigbee2mqttManager.installMqttContainer) MQTT broker container successfully started
2024-04-24T23:32:41+0200 <info> installZ2mContainer.js:34 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt container with USB dongle path /dev/ttyACM0 should be removed (new USB dongle path /dev/ttyUSB0 configured)...

After a restart of the docker container, the Z2M docker started up correctly. But no Z2M interface. Got the same error as the first time.

Maybe interesting for debugging:

docker inspect gladys-z2m-zigbee2mqtt | grep tty
                    "PathOnHost": "/dev/ttyUSB0",
                    "PathInContainer": "/dev/ttyACM0",

Does anyone have a clue of what to do to fix it?

P.s. I flashed the new Zigbee adapter with coordinator firmware and changed the IEEE to the old one, as pointed out on the Z2M FAQ.

P.s.s. Btw: the timezone of the docker is not synced with Gladys, mine is 2 hours off.

Edit: been busy trying to fix things and found a solution.
In /var/lib/gladysassistant/zigbee2mqtt/z2m/configuration.yaml the port was set to NULL. Changing that to /dev/ttyACM0 removed the “cannot open null” error.

After a restart of the docker images it worked again.
Not everything though, “still some failed (Data request failed with error: ‘MAC no ack’” in the z2m logs and some Aqara devices are not working. But that should be fixable by putting them in pairing mode again.

Hi @iZi !

I don’t know exactly what you did in which order, but there must have been a moment where indeed Z2M booted with a null in the yaml file… Not sure if it’s from Gladys, or from Z2M… Sorry I’m not very helpful :sweat_smile:

Good that it works now!

  1. The timezone of the container doesn’t really matter as you can set your timezone in Gladys UI (Settings → System)
  2. If you really want to have the container with your timezone, you can set it when starting the container :slight_smile:

When you first started Gladys, you set a TZ env variable to the container:

We put “Europe/Paris” as an example but it can be changed with your timezone