Z2M add-on not starting

I wonder if anyone can help me figure this out.
I am switching from ZHA to Z2m. My main reason is I can’t get my aqara rotatry switch to work even after trying out the custom quirk.
I am running HAOS in a VM on proxmox. I have not had much luck installing and configuring z2m on docker or LXC container - there is always a hiccup.
So I am finally trying to install z2z as a HA add on. The thing wont start and shows the following error:

[2024-05-10 00:07:43] error: z2m: Error while starting zigbee-herdsman
[2024-05-10 00:07:43] error: z2m: Failed to start zigbee
[2024-05-10 00:07:43] error: z2m: Check Zigbee2MQTT fails to start | Zigbee2MQTT for possible solutions
[2024-05-10 00:07:43] error: z2m: Exiting…
[2024-05-10 00:07:43] error: z2m: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:101:27)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:124:29)
at Zigbee.start (/app/lib/zigbee.ts:62:27)
at Controller.start (/app/lib/controller.ts:109:27)
at start (/app/index.js:107:5)

I am using Skyconnect and I can see it in home assistant. I have added the details to serial and I cannot figure out what the hiccup is.
Can anyone please help me out here.
I have also disabled ZHA.
Thanks

You are using a Skyconnect, but Zigbee2MQTT thinks you have a CC2652 adapter.
Show your Zigbee2MQTT configuration.

Interesting. Here it is

add

adapter: ezsp

to serial

Awesome. Thanks.
A side question… I have another coordinator - a sonoff. Can it work with z2m with the same ha install while also running ZHA?

You can use one dongle for Zigbee2MQTT and another dongle for ZHA, yes. But it is best to use different channels if using both.

Thanks for that.
I had a great idea of running z2m in docker in a virtual machine in proxmox. I plan to run other docker containers there too. I already have HAOS running in a separate VM and was considering migrating to docker sometime down the line. That has not worked out very much. I am having a hard time installing and configuring z2m. My main problem is the configuration.yml file. Do you have any experience with that? There are lots of guides but i found they are mostly confusing.

I run Zigbee2mqtt bare metal (npm install) in a VM on Proxmox

Can you point to a good guide to help with that?

You could just run Z2M in it’s own docker container (using a compose file). That’s what I do. Either way, npm-install or docker works well. If you want to migrate your existing configuration, just copy all the files from the addon’s /config directory to a directory on your new install, plug your adapter in and start Z2M.

zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt
    restart: unless-stopped
    volumes:
      - /srv/zigbee2mqtt/:/app/data
      - /run/udev:/run/udev:ro
    ports:
      # Frontend port
      - 8080:8080
    environment:
      - TZ=America/New_York

Can i do this in portainer without messing around in docker compose?

I mean, you could, but compose files make life SO much easier.

I’ve got some learning to do then

1 Like

lol story of my life.

But yeah, IIRC, portainer can handle compose files as well as straight docker run commands. But, even if it doesn’t, it doesn’t get much simpler than running docker compose up -d from the command line either.

I managed to install z2m but I can’t access the frontend. Looking at the logs the error is with mqtt. I am running mqtt as a HA add on.
Can you figure out what the problem is from these logs:

[2024-05-13 01:13:15] info: zh:zstack:znp: closing
[2024-05-13 01:13:15] info: zh:zstack:znp: Port closed
[2024-05-13 01:13:15] info: z2m: Stopped zigbee-herdsman
Using ‘/app/data’ as data directory
[2024-05-13 01:14:17] info: z2m: Logging to console, file (filename: log.log)
[2024-05-13 01:14:17] info: z2m: Starting Zigbee2MQTT version 1.37.1 (commit #ea39d86)
[2024-05-13 01:14:17] info: z2m: Starting zigbee-herdsman (0.46.6)
[2024-05-13 01:14:17] info: zh:zstack:znp: Opening SerialPort with {“path”:“/dev/ttyACM0”,“baudRate”:115200,“rtscts”:false,“autoOpen”:false}
[2024-05-13 01:14:17] info: zh:zstack:znp: Serialport opened
[2024-05-13 01:14:18] info: z2m: zigbee-herdsman started (resumed)
[2024-05-13 01:14:18] info: z2m: Coordinator firmware version: ‘{“meta”:{“maintrel”:1,“majorrel”:2,“minorrel”:7,“product”:1,“revision”:20210708,“transportrev”:2},“type”:“zStack3x0”}’
[2024-05-13 01:14:18] info: z2m: Currently 0 devices are joined:
[2024-05-13 01:14:18] info: z2m: Zigbee: disabling joining new devices.
[2024-05-13 01:14:18] info: z2m: Connecting to MQTT server at mqtt://localhost
[2024-05-13 01:14:18] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:14:18] error: z2m: MQTT failed to connect, exiting…
[2024-05-13 01:14:18] info: z2m: Stopping zigbee-herdsman…
[2024-05-13 01:14:19] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:14:20] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:14:21] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:14:22] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:14:23] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:14:24] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:14:25] info: zh:controller: Wrote coordinator backup to ‘/app/data/coordinator_backup.json’
[2024-05-13 01:14:25] info: zh:zstack:znp: closing
[2024-05-13 01:14:25] info: zh:zstack:znp: Port closed
[2024-05-13 01:14:25] info: z2m: Stopped zigbee-herdsman
Using ‘/app/data’ as data directory
[2024-05-13 01:15:26] info: z2m: Logging to console, file (filename: log.log)
[2024-05-13 01:15:26] info: z2m: Starting Zigbee2MQTT version 1.37.1 (commit #ea39d86)
[2024-05-13 01:15:26] info: z2m: Starting zigbee-herdsman (0.46.6)
[2024-05-13 01:15:27] info: zh:zstack:znp: Opening SerialPort with {“path”:“/dev/ttyACM0”,“baudRate”:115200,“rtscts”:false,“autoOpen”:false}
[2024-05-13 01:15:27] info: zh:zstack:znp: Serialport opened
[2024-05-13 01:15:27] info: z2m: zigbee-herdsman started (resumed)
[2024-05-13 01:15:27] info: z2m: Coordinator firmware version: ‘{“meta”:{“maintrel”:1,“majorrel”:2,“minorrel”:7,“product”:1,“revision”:20210708,“transportrev”:2},“type”:“zStack3x0”}’
[2024-05-13 01:15:27] info: z2m: Currently 0 devices are joined:
[2024-05-13 01:15:27] info: z2m: Zigbee: disabling joining new devices.
[2024-05-13 01:15:27] info: z2m: Connecting to MQTT server at mqtt://localhost
[2024-05-13 01:15:27] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:15:27] error: z2m: MQTT failed to connect, exiting…
[2024-05-13 01:15:27] info: z2m: Stopping zigbee-herdsman…
[2024-05-13 01:15:28] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:15:29] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:15:30] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:15:31] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:15:32] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:15:33] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:15:34] info: zh:controller: Wrote coordinator backup to ‘/app/data/coordinator_backup.json’
[2024-05-13 01:15:34] info: zh:zstack:znp: closing
[2024-05-13 01:15:34] info: zh:zstack:znp: Port closed
[2024-05-13 01:15:34] info: z2m: Stopped zigbee-herdsman
Using ‘/app/data’ as data directory
[2024-05-13 01:16:36] info: z2m: Logging to console, file (filename: log.log)
[2024-05-13 01:16:36] info: z2m: Starting Zigbee2MQTT version 1.37.1 (commit #ea39d86)
[2024-05-13 01:16:36] info: z2m: Starting zigbee-herdsman (0.46.6)
[2024-05-13 01:16:36] info: zh:zstack:znp: Opening SerialPort with {“path”:“/dev/ttyACM0”,“baudRate”:115200,“rtscts”:false,“autoOpen”:false}
[2024-05-13 01:16:36] info: zh:zstack:znp: Serialport opened
[2024-05-13 01:16:36] info: z2m: zigbee-herdsman started (resumed)
[2024-05-13 01:16:36] info: z2m: Coordinator firmware version: ‘{“meta”:{“maintrel”:1,“majorrel”:2,“minorrel”:7,“product”:1,“revision”:20210708,“transportrev”:2},“type”:“zStack3x0”}’
[2024-05-13 01:16:36] info: z2m: Currently 0 devices are joined:
[2024-05-13 01:16:36] info: z2m: Zigbee: disabling joining new devices.
[2024-05-13 01:16:37] info: z2m: Connecting to MQTT server at mqtt://localhost
[2024-05-13 01:16:37] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:16:37] error: z2m: MQTT failed to connect, exiting…
[2024-05-13 01:16:37] info: z2m: Stopping zigbee-herdsman…
[2024-05-13 01:16:38] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:16:39] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:16:40] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:16:41] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:16:42] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:16:43] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:16:43] info: zh:controller: Wrote coordinator backup to ‘/app/data/coordinator_backup.json’
[2024-05-13 01:16:43] info: zh:zstack:znp: closing
[2024-05-13 01:16:44] info: zh:zstack:znp: Port closed
[2024-05-13 01:16:44] info: z2m: Stopped zigbee-herdsman
Using ‘/app/data’ as data directory
[2024-05-13 01:17:45] info: z2m: Logging to console, file (filename: log.log)
[2024-05-13 01:17:45] info: z2m: Starting Zigbee2MQTT version 1.37.1 (commit #ea39d86)
[2024-05-13 01:17:45] info: z2m: Starting zigbee-herdsman (0.46.6)
[2024-05-13 01:17:46] info: zh:zstack:znp: Opening SerialPort with {“path”:“/dev/ttyACM0”,“baudRate”:115200,“rtscts”:false,“autoOpen”:false}
[2024-05-13 01:17:46] info: zh:zstack:znp: Serialport opened
[2024-05-13 01:17:46] info: z2m: zigbee-herdsman started (resumed)
[2024-05-13 01:17:46] info: z2m: Coordinator firmware version: ‘{“meta”:{“maintrel”:1,“majorrel”:2,“minorrel”:7,“product”:1,“revision”:20210708,“transportrev”:2},“type”:“zStack3x0”}’
[2024-05-13 01:17:46] info: z2m: Currently 0 devices are joined:
[2024-05-13 01:17:46] info: z2m: Zigbee: disabling joining new devices.
[2024-05-13 01:17:46] info: z2m: Connecting to MQTT server at mqtt://localhost
[2024-05-13 01:17:46] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:17:46] error: z2m: MQTT failed to connect, exiting…
[2024-05-13 01:17:46] info: z2m: Stopping zigbee-herdsman…
[2024-05-13 01:17:47] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:17:48] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:17:49] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:17:50] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:17:51] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:17:52] error: z2m: MQTT error: connect ECONNREFUSED ::1:1883
[2024-05-13 01:17:53] info: zh:controller: Wrote coordinator backup to ‘/app/data/coordinator_backup.json’
[2024-05-13 01:17:53] info: zh:zstack:znp: closing
[2024-05-13 01:17:53] info: zh:zstack:znp: Port closed
[2024-05-13 01:17:53] info: z2m: Stopped zigbee-herdsman
Using ‘/app/data’ as data directory

Did you use the same username and password in both Mosquitto and Zigbee2MQTT ?

Yes. I had made sure of that. I will double check.
Silly me! I was editing the wrong configuration.yaml file - I had created one before correctly completing the installation.

I am still not out of the woods though.

I am getting a different error now.
When I passed the device through to the vm initially and ran ls -l /dev/serial/by-id it lists my Sonoff D dongle P as a SkyConnect. I passed through the entire port for it to be listed correctly as a Sonoff. However when I start the docker i see a coordinator mismatch in the log. In the configuration i listed port as /dev/serial/ttyUSB as that is what i get when i run ls -l /dev/serial/by-id .

This is the log from portainer:

Using ‘/app/data’ as data directory
[2024-05-13 11:36:48] info: z2m: Logging to console, file (filename: log.log)
[2024-05-13 11:36:48] info: z2m: Starting Zigbee2MQTT version 1.37.1 (commit #ea39d86)
[2024-05-13 11:36:48] info: z2m: Starting zigbee-herdsman (0.46.6)
[2024-05-13 11:36:48] error: zh:zstack:znp: Failed to determine if path is valid: ‘Error: ENOENT: no such file or directory, lstat ‘/dev/ttyUSB0’’
[2024-05-13 11:36:48] info: zh:zstack:znp: Opening SerialPort with {“path”:“/dev/ttyUSB0”,“baudRate”:115200,“rtscts”:false,“autoOpen”:false}
[2024-05-13 11:36:48] error: z2m: Error while starting zigbee-herdsman
[2024-05-13 11:36:48] error: z2m: Failed to start zigbee
[2024-05-13 11:36:48] error: z2m: Check Zigbee2MQTT fails to start | Zigbee2MQTT for possible solutions
[2024-05-13 11:36:48] error: z2m: Exiting…
[2024-05-13 11:36:48] error: z2m: Error: Error: No such file or directory, cannot open /dev/ttyUSB0

EDIT:

I switch the coordinator from a USB 3 to a USB 2 port and it now shows up correctly as a sonoff dongle, however, I am still getting the error:

[2024-05-13 11:57:43] info: z2m: Logging to console, file (filename: log.log)
[2024-05-13 11:57:43] info: z2m: Starting Zigbee2MQTT version 1.37.1 (commit #ea39d86)
[2024-05-13 11:57:43] info: z2m: Starting zigbee-herdsman (0.46.6)
[2024-05-13 11:57:44] error: zh:zstack:znp: Failed to determine if path is valid: ‘Error: ENOENT: no such file or directory, lstat ‘/app/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0’’
[2024-05-13 11:57:44] info: zh:zstack:znp: Opening SerialPort with {path:usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0,baudRate:115200,rtscts:false,autoOpen:false}
[2024-05-13 11:57:44] error: z2m: Error while starting zigbee-herdsman
[2024-05-13 11:57:44] error: z2m: Failed to start zigbee
[2024-05-13 11:57:44] error: z2m: Check Zigbee2MQTT fails to start | Zigbee2MQTT for possible solutions
[2024-05-13 11:57:44] error: z2m: Exiting…
[2024-05-13 11:57:44] error: z2m: Error: Error: No such file or directory, cannot open usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0

What exactly does ls -l /dev/serial/by-id say?

1 Like

This won’t work in a docker container. Localhost will point to the internal IP address in the container. You need to point to where ever you are running MQTT. If that’s another container on the same machine, then you need to change your MQTT to point to the IP address of the host.

I sorted that when i realized i was editing the wrong file

1 Like