Cannot get zigbee running Topic is solved

Xiaomi, Ikea TRÅDFRI, Philips Hue and more.

Moderator: leecollings

hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Cannot get zigbee running

Post 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
hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cannot get zigbee running

Post 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
User avatar
waltervl
Posts: 5775
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Cannot get zigbee running

Post by waltervl »

What does the zigbee2mqtt log file say?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cannot get zigbee running

Post 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
hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cannot get zigbee running

Post by hjzwiers »

I changed the usb port to the front and the ID doesn't change ..........
User avatar
waltervl
Posts: 5775
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Cannot get zigbee running

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cannot get zigbee running

Post by hjzwiers »

I checked and it matched, I ran the code with the :/dev/ttyUSB0 extension already, failed.

I also added quotes, no improvement
jannl
Posts: 666
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Cannot get zigbee running

Post 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
User avatar
waltervl
Posts: 5775
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Cannot get zigbee running

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Kedi
Posts: 569
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Cannot get zigbee running

Post 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.
Logic will get you from A to B. Imagination will take you everywhere.
hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cannot get zigbee running

Post 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.
jannl
Posts: 666
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Cannot get zigbee running

Post by jannl »

The upper part is the zigbee2mqtt configuration yaml?

Shouldn;t the port be /dev/ttyUSB0 as set in de sigbee2mqtt container settings?
FlyingDomotic
Posts: 349
Joined: Saturday 27 February 2016 0:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: Cannot get zigbee running

Post 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'
jannl
Posts: 666
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Cannot get zigbee running

Post 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
hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cannot get zigbee running

Post 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
jannl
Posts: 666
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Cannot get zigbee running

Post 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.
hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cannot get zigbee running

Post 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
User avatar
waltervl
Posts: 5775
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Cannot get zigbee running

Post by waltervl »

Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
jannl
Posts: 666
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Cannot get zigbee running

Post by jannl »

And check http://<your-ip>:8085, where 8085 is your frontend port
hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cannot get zigbee running

Post by hjzwiers »

It is working, still waiting for clients, sent back the sonoff 260 plugs, tomorrow I will get new ones
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest