Page 1 of 2

Cannot get zigbee running

Posted: Monday 03 February 2025 20:34
by hjzwiers
I have MQTT, Zigbee and Zwave running in a single container. I get Zigbee started but I cant get it running. Can anyone help?

services:

eclipse-mosquitto:
container_name: myMosquitto
image: 'eclipse-mosquitto:latest'
restart: always
volumes:
- /home/hjz/docker/mosquitto/conf/mosquitto.conf:/mosquitto.conf
- /home/hjz/docker/mosquitto/data:/mosquitto/data
- /home/hjz/docker/mosquitto/log:/mosquitto/log
ports:
- '1883:1883'
- '9001:9001'
command: "mosquitto -c /mosquitto-no-auth.conf"

zigbee2mqtt:
container_name: zigbee2mqtt
image: koenkk/zigbee2mqtt
restart: unless-stopped
volumes:
- /home/hjz/docker/zigbee2mqtt/data:/app/data
- /home/hjz/docker/zigbee2mqtt/run/udev:/run/udev:ro
ports:
# Frontend port
- '8085:8085'
environment:
- TZ=Europe/Amsterdam
devices:
# Make sure this matched your adapter location
- /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0

zwave-js-ui:
container_name: zwave-js-ui
image: zwavejs/zwave-js-ui:latest
restart: always
tty: true
stop_signal: SIGINT
environment:
- SESSION_SECRET=mysupersecretkey
- ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
# Uncomment if you want logs time and dates to match your timezone instead of UTC
# Available at https://en.wikipedia.org/wiki/List_of_t ... time_zones
- TZ=Europe/Amsterdam
networks:
- zwave
devices:
# Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
# Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
- '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
volumes:
- /home/hjz/docker/zwjs/store:/usr/src/app/store
ports:
- '8091:8091' # port for web interface
- '3001:3001' # port for Z-Wave JS websocket server

networks:
zwave:
volumes:
zwave-config:
name: zwave-config

And my config file

version: 4
homeassistant: true
permit_join: true
frontend:
enabled: true
mqtt:
base_topic: zigbee2mqtt
server: mqtt://192.168.2.71:1883
serial:
port: /dev/ttyUSB0
#port: /dev/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0
#adapter: zstack
advanced:
homeassistant_legacy_entity_attributes: false
legacy_api: false
legacy_availability_payload: false
device_options:
legacy: false


hjz@debian:~/docker$ docker compose up -d
[+] Running 3/0
✔ Container myMosquitto Running 0.0s
✔ Container zwave-js-ui Running 0.0s
✔ Container zigbee2mqtt Started

Re: Cannot get zigbee running

Posted: Monday 03 February 2025 21:54
by hjzwiers
I needed to put the config file in "ember" mode with the Sonoff stick, no extra result, the MQTT file is empty :-(

version: 4
homeassistant: false
permit_join: true
frontend:
enabled: true
mqtt:
base_topic: zigbee2mqtt
server: mqtt://192.168.2.71:1883
serial:
# port: /dev/ttyUSB0
port: /dev/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0
adapter: ember

Re: Cannot get zigbee running

Posted: Monday 03 February 2025 22:07
by waltervl
What does the zigbee2mqtt log file say?

Re: Cannot get zigbee running

Posted: Monday 03 February 2025 22:15
by hjzwiers
[2025-02-03 20:04:45] info: z2m: Logging to console, file (filename: log.log)
[2025-02-03 20:04:45] info: z2m: Starting Zigbee2MQTT version 2.1.0 (commit #5e9d53f0aa94c947837dbb8252b1c70ff3bc08a2)
[2025-02-03 20:04:45] info: z2m: Starting zigbee-herdsman (3.2.5)
[2025-02-03 20:04:45] info: zh:zstack:znp: Opening SerialPort with {"path":"/dev/ttyUSB0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2025-02-03 20:04:45] error: z2m: Error while starting zigbee-herdsman
[2025-02-03 20:04:45] error: z2m: Failed to start zigbee-herdsman
[2025-02-03 20:04:45] error: z2m: Check https://www.zigbee2mqtt.io/guide/instal ... ntime.html for possible solutions
[2025-02-03 20:04:45] error: z2m: Exiting...
[2025-02-03 20:04:45] error: z2m: Error: Error: No such file or directory, cannot open /dev/ttyUSB0

Re: Cannot get zigbee running

Posted: Monday 03 February 2025 22:55
by hjzwiers
I changed the usb port to the front and the ID doesn't change ..........

Re: Cannot get zigbee running

Posted: Monday 03 February 2025 23:13
by waltervl
Check the docker instructions for zigbee2mqtt
https://www.zigbee2mqtt.io/guide/instal ... ocker.html

Add /dev/ttyUSB0 to the zigbee2mqtt docker container device setting.

Code: Select all

# Make sure this matched your adapter location
device=/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0:/dev/ttyUSB0

Re: Cannot get zigbee running

Posted: Monday 03 February 2025 23:19
by hjzwiers
I checked and it matched, I ran the code with the :/dev/ttyUSB0 extension already, failed.

I also added quotes, no improvement

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 7:45
by jannl
At first, you do not have a single container configured, but several. You just have 1 docker compose file.

The usb (I also use persistent USB (see the wiki and/or forum)) line in my docker-compose.yml file is:

Code: Select all

    devices:
      - /dev/ttyACM-NewZigbee:/dev/ttyACM-NewZigbee
I am missing the colon (:) in your file, but I am not sure if that actually is needed

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 8:41
by waltervl
jannl wrote: Tuesday 04 February 2025 7:45 At first, you do not have a single container configured, but several. You just have 1 docker compose file.

The usb (I also use persistent USB (see the wiki and/or forum)) line in my docker-compose.yml file is:

Code: Select all

    devices:
      - /dev/ttyACM-NewZigbee:/dev/ttyACM-NewZigbee
I am missing the colon (:) in your file, but I am not sure if that actually is needed
Currently with newer OS the /dev/serial/by-id/ way is the best way. No need to make a USB device persistent the old way. Also indicated in the Wiki for some time now.

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 9:07
by Kedi
If you put more that 1 service in 1 compose file, I always put some healthchecks and depends_on in those files.
You can have race conditions for starting up the different services.
Beter is to have separate compose files for each service, than you have at first manual control about the startup order.

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 12:52
by hjzwiers
I did all the checks:

version: 4
homeassistant: false
permit_join: true
frontend:
enabled: true
mqtt:
base_topic: zigbee2mqtt
server: mqtt://192.168.2.71:1883
serial:
port: /dev/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0
adapter: zstack
advanced:
log_level: info

zigbee2mqtt:
container_name: zigbee2mqtt
image: koenkk/zigbee2mqtt
restart: unless-stopped
volumes:
- /home/hjz/docker/zigbee2mqtt/data:/app/data
- /home/hjz/docker/zigbee2mqtt/run/udev:/run/udev:ro
ports:
# Frontend port
- '8085:8085'
environment:
- TZ=Europe/Amsterdam
devices:
# Make sure this matched your adapter location
- '/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0:/dev/ttyUSB0'

All I get now is that the docker is started, and also no logging anymore.... This cannot be so complex.

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 13:40
by jannl
The upper part is the zigbee2mqtt configuration yaml?

Shouldn;t the port be /dev/ttyUSB0 as set in de sigbee2mqtt container settings?

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 14:23
by FlyingDomotic
It seems that port is not the right one. Try with:

Code: Select all

port: '/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0:/dev/ttyUSB0'

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 14:30
by jannl
The port in the configuration.yaml should be (based on the setting in the docker-compose.yml)

Code: Select all

serial:
  port: /dev/ttyUSB0

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 16:19
by hjzwiers
[2025-02-04 16:04:11] debug: z2m: Removing old log directory '/app/data/log/2025-02-04.15-54-00'
[2025-02-04 16:04:11] info: z2m: Logging to console, file (filename: log.log)
[2025-02-04 16:04:11] debug: z2m: Can't load state from file /app/data/state.json (doesn't exist)
[2025-02-04 16:04:11] info: z2m: Starting Zigbee2MQTT version 2.1.0 (commit #5e9d53f0aa94c947837dbb8252b1c70ff3bc08a2)
[2025-02-04 16:04:11] debug: z2m: sd-notify loaded
[2025-02-04 16:04:11] info: z2m: Starting zigbee-herdsman (3.2.5)
[2025-02-04 16:04:11] debug: z2m: Using zigbee-herdsman with settings: '"{\"network\":{\"panID\":6754,\"extendedPanID\":[221,221,221,221,221,221,221,221],\"channelList\":[11],\"networkKey\":\"HIDDEN\"}>
[2025-02-04 16:04:11] debug: zh:adapter:discovery: Connected devices: [{"path":"/dev/ttyACM0"},{"path":"/dev/ttyS0"},{"path":"/dev/ttyS1"},{"path":"/dev/ttyS2"},{"path":"/dev/ttyS3"},{"path":"/dev/ttyU>
[2025-02-04 16:04:11] debug: zh:adapter:discovery: Unable to match USB adapter: zstack | /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0
[2025-02-04 16:04:11] debug: zh:controller: Starting with options '{"network":{"networkKeyDistribute":false,"networkKey":"HIDDEN","panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channel>
[2025-02-04 16:04:11] info: zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0","baudRate":115200>
[2025-02-04 16:04:11] error: z2m: Error while starting zigbee-herdsman
[2025-02-04 16:04:11] error: z2m: Failed to start zigbee-herdsman
[2025-02-04 16:04:11] error: z2m: Check https://www.zigbee2mqtt.io/guide/instal ... ntime.html for possible solutions
[2025-02-04 16:04:11] error: z2m: Exiting...
[2025-02-04 16:04:11] error: z2m: Error: Error: No such file or directory, cannot open /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b

It seems it cannot find the adapter, but it is exactly as written, what to do? I tried to change to port to /dev/ttyUSB0, no result

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 16:55
by jannl
This path: /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_f87384e6086bef1181b697adc169b110-if00-port0 is most likely not reachable from with the docker container.

Try my comments.

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 20:59
by hjzwiers
I found further documentation and with the help from Walter and Jannl I got it going.

Only I cannot connect anything, small detail. Is there any way you can the the broadcasting of the transmitter?

Thanks

Re: Cannot get zigbee running

Posted: Tuesday 04 February 2025 21:18
by waltervl

Re: Cannot get zigbee running

Posted: Wednesday 05 February 2025 16:32
by jannl
And check http://<your-ip>:8085, where 8085 is your frontend port

Re: Cannot get zigbee running

Posted: Thursday 06 February 2025 13:49
by hjzwiers
It is working, still waiting for clients, sent back the sonoff 260 plugs, tomorrow I will get new ones