#zigbee2mqtt container issues
1 messages Β· Page 1 of 1 (latest)
Enable the frontend, runs on port 8080 by default
frontend:
enabled: true
port: 8080
from the configuration.yaml
Large font was comment - not sure why it was made a heading in here though
Because you didn't use code markup π
To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.
That's in the Z2M configuration.yaml?
yes
2025/01/27 11:58AM WRN github.com/portainer/portainer/pkg/libstack/compose/internal/composeplugin/composeplugin.go:171 > docker compose command failed | error="exit status 15" error_output="validating /data/compose/19/docker-compose.yml: services.zigbee2mqtt Additional property server is not allowed\n" output=
2025/01/27 11:59AM WRN github.com/portainer/portainer/pkg/libstack/compose/internal/composeplugin/composeplugin.go:171 > docker compose command failed | error="exit status 15" error_output="validating /data/compose/20/docker-compose.yml: services.zigbee2mqtt must be a mapping\n" output=
got this from z2m log
*sorry, that's portainer log
Code markup is everybody's friend π
Please also share the compose entry, because that looks to be the problem
cat /var/lib/docker/volumes/portainer_data/_data/custom_templates/2/docker-compose.yml
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /opt/homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
restart: unless-stopped
privileged: true
network_mode: host
mosquitto:
image: eclipse-mosquitto
container_name: mosquitto
volumes:
- /opt/mosquitto:/mosquitto
- /opt/mosquitto/data:/mosquitto/data
- /opt/mosquitto/log:/mosquitto/log
ports:
- 1883:1883
- 9001:9001
zigbee2mqtt:
# homeassistant:
# mqtt: true
# mqttDiscovery: true
# mqttDiscoveryPrefix: homeassistant
# frontend:
# enabled: true
# port: 8080
# mqtt:
# base_topic: zigbee2mqtt
# server: mqtt://172.17.0.4
# user: MQTT-user
# password: Mechasaur
# serial:
# port: /dev/ttyUSB0
# # Adapter type, allowed values: `zstack`, `ember`, `deconz`, `zigate` or `zboss`
# adapter: ember
# Periodically check whether devices are online/offline
# availability:
# enabled: true
# Advanced settings
# advanced:
# channel: 11
# Let Zigbee2MQTT generate a network key on first start
# network_key: GENERATE
# Let Zigbee2MQTT generate a pan_id on first start
# pan_id: GENERATE
# Let Zigbee2MQTT generate a ext_pan_id on first start
# ext_pan_id: GENERATE
I'm afraid I added most of that in an attempt to help the containers connections, this was a template I made from Portainer and then added the lower lines
Ummm.... was that your compose file?
Because none of the Z2M config should be in there
You should use the lines shown in the Z2M docs for the compose file entry
Yeah, as I said, I cocked it up π
maybe too much "tinkering" , or at least uninformed tinkering π
for now better sleep on it, thank you for your help
root@CM3588-Plus:/opt/zigbee2mqtt# sudo rm -rf *
root@CM3588-Plus:/opt/zigbee2mqtt# ls
root@CM3588-Plus:/opt/zigbee2mqtt# ls -alh
total 8.0K
drwxr-xr-x 2 root root 4.0K Jan 29 10:21 .
drwxr-xr-x 1 root root 4.0K Jan 27 19:15 ..
root@CM3588-Plus:/opt/zigbee2mqtt# mkdir data && wget https://raw.githubusercontent.com/Koenkk/zigbee2mqtt/master/data/configuration.example.yaml -O data/configuration.yaml
mkdir: cannot create directory βdataβ: File exists
not sure what's going on here, I thought I'd clear out the directory and start from scratch, although I have deleted the contents and verified that I still get a message to say the data dir exists
Ok, seems the container was running so maybe I'm not going nuts just yet π
Creating configuration file...
Starting Zigbee2MQTT without watchdog.
[2025-01-29 12:11:23] info: z2m: Logging to console, file (filename: log.log)
[2025-01-29 12:11:23] info: z2m: Starting Zigbee2MQTT version 2.0.0 (commit #060ae99cff715cc9ef6a0cfa7cae0cdcb17f0c8a)
[2025-01-29 12:11:23] info: z2m: Starting zigbee-herdsman (3.2.1)
[2025-01-29 12:11:23] info: zh:adapter:discovery: Matched adapter: {"path":"/dev/ttyUSB0","manufacturer":"Itead","serialNumber":"08a22b8ace8bee1189dcfc018acbdcd8","pnpId":"usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_08a22b8ace8bee1189dcfc018acbdcd8-if00-port0","vendorId":"10c4","productId":"ea60"} => zstack: path=/dev/ttyUSB0, score=4
[2025-01-29 12:11:23] info: zh:zstack:znp: Opening SerialPort with {"path":"/dev/ttyUSB0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2025-01-29 12:11:23] info: zh:zstack:znp: Serialport opened
[2025-01-29 12:11:23] info: zh:zstack:znp: Writing CC2530/CC2531 skip bootloader payload
[2025-01-29 12:11:24] info: zh:zstack:znp: Skip bootloader for CC2652/CC1352
[2025-01-29 12:11:43] error: z2m: Error while starting zigbee-herdsman
[2025-01-29 12:11:43] error: z2m: Failed to start zigbee-herdsman
[2025-01-29 12:11:43] error: z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions
[2025-01-29 12:11:43] error: z2m: Exiting...
[2025-01-29 12:11:43] error: z2m: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
at ZStackAdapter.start (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:113:27)
at Controller.start (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/controller/controller.ts:136:29)
at Zigbee.start (/app/lib/zigbee.ts:69:27)
at Controller.start (/app/lib/controller.ts:142:13)
at start (/app/index.js:161:5)
This result from downloaded config unaltered, should I be specifying the ember adapter in the config?
Yes, you should - that's even called out in the Z2M docs for that adapter
zigbee2mqtt
βββ data
βββ configuration.yaml
βββ data
βββ configuration.yaml
βββ database.db
βββ log
βΒ Β βββ 2025-01-30.11-42-09
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-30.11-42-32
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-30.11-42-56
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-30.11-43-19
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-30.11-43-42
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-30.11-44-05
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-30.11-44-28
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-30.11-44-51
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-30.11-45-15
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-30.11-45-38
βΒ Β βββ log.log
βββ state.json
The plot thickens..I found another config file, this looks like a double up, can I copy the second data dir back to zigbee2mqtt dir and remove the first data dir?
root@CM3588-Plus:/opt/zigbee2mqtt/data/data# cat configuration.yaml
version: 4
homeassistant:
enabled: false
frontend:
enabled: true
mqtt:
base_topic: zigbee2mqtt
server: mqtt:172.17.0.4
user: XXXXXXX
password: XXXXXXXX
serial:
port: /dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_08a22b8ace8bee1189dcfc018acbdcd8-if00-port0
adapter: ember
advanced:
network_key:
- 92
- 58
- 165
- 168
- 106
- 147
- 141
- 17
- 30
- 230
- 249
- 148
- 137
- 251
- 175
- 82
pan_id: 28537
ext_pan_id:
- 198
- 44
- 185
- 238
- 83
- 146
- 205
- 128
This is the current "nested" config file..
[2025-01-30 12:43:34] info: zh:ember:uart:ash: Out of sequence : RX=0
[2025-01-30 12:43:34] info: zh:ember:uart:ash: ACK timeouts : RX=0
[2025-01-30 12:43:34] info: zh:ember:uart:ash: ======== ASH stopped ========
[2025-01-30 12:43:34] error: zh:ember:uart:ash: Failed to init port with error Error: Error: No such file or directory, cannot open /dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_08a22b8ace8bee1189dcfc018acbdcd8-if00-port0
[2025-01-30 12:43:34] error: z2m: Error while starting zigbee-herdsman
[2025-01-30 12:43:34] error: z2m: Failed to start zigbee-herdsman
[2025-01-30 12:43:34] error: z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions
[2025-01-30 12:43:34] error: z2m: Exiting...
[2025-01-30 12:43:34] error: z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.
at EmberAdapter.initEzsp (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:670:19)
at EmberAdapter.start (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1533:24)
at Controller.start (/app/node_modules/.pnpm/zigbee-herdsman@3.2.1/node_modules/zigbee-herdsman/src/controller/controller.ts:136:29)
at Zigbee.start (/app/lib/zigbee.ts:69:27)
at Controller.start (/app/lib/controller.ts:142:13)
at start (/app/index.js:161:5)
Using '/app/data' as data directory
Starting Zigbee2MQTT without watchdog
And the log report, seems the dongle is not accessible for some reason
2025-01-29 01:33:05.331 ERROR (MainThread) [homeassistant.components.mqtt.client] Failed to connect to MQTT server due to exception: [Errno 111] Connection refused
This from HA logs
Mosquitto logs are empty
These from Portainer
Looks like you've got two unrelated issues.
- First is Z2M being unable to contact the stick. That can happen if the stick is already in use - eg if you set up ZHA or the Sonoff auto discovered integration in HA.
- HA can't talk to the MQTT broker
I could easily have two unrelated issues π At one point HA had picked up the sonoff and I had an integration for ZHA (unconfigured), but I removed the ZHA integration
It may be that you need to reboot to free the stick up, I don't know how that works with HAOS
I have rebooted the machine a couple of times, should I have an mqtt integration in HA?
Yes, that's needed for HA to talk to the broker, and so to Zigbee2MQTT
Ok, I have that, not for z2m?
What do you mean?
no integration in HA for z2m
Ok, I did read an overview of mqtt but not familiar with anything
It's a messaging platform for computers, basically
Yes, runs a server? to queue messages and relay them to devices
Ah, there was a subscription involved, publish and pull messages
There's lots of good primers out there if you're interested
I thought this mqtt setup sounded like a good idea, just a bit of a mission to set up for the likes of me π
If you want the easy route, ZHA should just work
well, I was almost going that route, had a ZHA integration but there was some issue with the dongle still
You may have a bad dongle then
I did update the dongle to latest firmware, wasn't really sure if I had to did that as part of tinkering to get something to work
I may have to dissappear, much rumbling and lightning atm
version: 4
homeassistant:
enabled: false
frontend:
enabled: true
mqtt:
base_topic: zigbee2mqtt
server: mqtt://172.17.0.4
user: MQTT-user
password: Mechasaur
serial:
# port: /dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_08a22b8ace8bee1189dcfc018acbdcd8-if00-port0
port: /dev/ttyUSB0
adapter: ember
advanced:
network_key:
- 92
- 58
- 165
- 168
- 106
- 147
- 141
- 17
- 30
- 230
- 249
- 148
- 137
- 251
- 175
- 82
pan_id: 28537
ext_pan_id:
- 198
- 44
- 185
- 238
- 83
- 146
- 205
- 128
took out the /dev/serial/by-id/... and just used /dev/ttyUSB0 and z2m started
still no front end reachable though
[2025-01-31 18:51:14] info: z2m: Currently 0 devices are joined.
[2025-01-31 18:51:14] info: z2m: Connecting to MQTT server at mqtt://172.17.0.4
[2025-01-31 18:51:14] info: z2m: Connected to MQTT server
[2025-01-31 18:51:14] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
[2025-01-31 18:51:14] info: z2m: Started frontend on port 8080
[2025-01-31 18:51:14] info: z2m: Zigbee2MQTT started!
2025/01/27 11:47AM WRN github.com/portainer/portainer/pkg/libstack/compose/internal/composeplugin/composeplugin.go:171 > docker compose command failed | error="exit status 15" error_output="validating /data/compose/10/docker-compose.yml: services.zigbee2mqtt Additional property serial is not allowed\n"
this from portainer, must have a compose issue so gotta find that file
/opt/zigbee2mqtt# tree
.
βββ data
βββ configuration.yaml
βββ data
βΒ Β βββ configuration.yaml
βΒ Β βββ coordinator_backup.json
βΒ Β βββ database.db
βΒ Β βββ database.db.backup
βΒ Β βββ log
βΒ Β βΒ Β βββ 2025-01-31.18-35-28
βΒ Β βΒ Β βΒ Β βββ log.log
βΒ Β βΒ Β βββ 2025-01-31.18-36-31
βΒ Β βΒ Β βΒ Β βββ log.log
βΒ Β βΒ Β βββ 2025-01-31.18-37-34
βΒ Β βΒ Β βΒ Β βββ log.log
βΒ Β βΒ Β βββ 2025-01-31.18-38-36
βΒ Β βΒ Β βΒ Β βββ log.log
βΒ Β βΒ Β βββ 2025-01-31.18-39-39
βΒ Β βΒ Β βΒ Β βββ log.log
βΒ Β βΒ Β βββ 2025-01-31.18-40-42
βΒ Β βΒ Β βΒ Β βββ log.log
βΒ Β βΒ Β βββ 2025-01-31.18-41-45
βΒ Β βΒ Β βΒ Β βββ log.log
βΒ Β βΒ Β βββ 2025-01-31.18-42-48
βΒ Β βΒ Β βΒ Β βββ log.log
βΒ Β βΒ Β βββ 2025-01-31.18-43-20
βΒ Β βΒ Β βΒ Β βββ log.log
βΒ Β βΒ Β βββ 2025-01-31.18-51-12
βΒ Β βΒ Β βββ log.log
βΒ Β βββ state.json
βββ database.db
βββ log
βΒ Β βββ 2025-01-31.16-44-36
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-31.16-45-38
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-31.16-46-41
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-31.16-47-44
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-31.16-48-47
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-31.16-49-49
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-31.16-50-52
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-31.16-51-55
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-31.16-52-58
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-01-31.16-54-00
βΒ Β βββ log.log
βββ state.json
this confuses me, I removed the nesting to have only one config.yml and upon rebooting I now have it back
seems to navigate to the most nested config file
Portainer ... yeah
I personally hate it, it's caused people all sorts of problems over the years
If you want to use compose files and a web UI then https://github.com/louislam/dockge is worth a look
Ta, I'll have a look π
I was assuming I needed the GUI for setup, can I run headless? How does that play with Portainer?
I've never yet used a GUI for setting up containers - everything is done with SSH and the command line
Dockge does look good
well, if I don't need a GUI why do I care if it won't connect? From the logs it seems the z2a can connect to mosquitto, where to from here?
I'd go back to checking the Portainer settings for the container, you either need to map the frontend port or use host networking
Ok, getting late, might be tomorrow's mission π
root@CM3588-Plus:/opt/zigbee2mqtt# tree
.
βββ data
βββ configuration.yaml
βββ coordinator_backup.json
βββ database.db
βββ log
βΒ Β βββ 2025-02-01.09-06-09
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-02-01.09-12-56
βΒ Β βΒ Β βββ log.log
βΒ Β βββ 2025-02-01.09-23-33
βΒ Β βββ log.log
βββ state.json
much cleaner now, although still no front-end access
[2025-02-01 09:23:35] info: zh:ember:ezsp: ======== EZSP started ========
[2025-02-01 09:23:35] info: zh:ember: Adapter EZSP protocol version (13) lower than Host. Switched.
[2025-02-01 09:23:35] info: zh:ember: Adapter version info: {"ezsp":13,"revision":"7.4.5 [GA]","build":0,"major":7,"minor":4,"patch":5,"special":0,"type":170}
[2025-02-01 09:23:35] info: zh:ember: [STACK STATUS] Network up.
[2025-02-01 09:23:35] info: zh:ember: [INIT TC] Adapter network matches config.
[2025-02-01 09:23:35] info: zh:ember: [CONCENTRATOR] Started source route discovery. 1247ms until next broadcast.
[2025-02-01 09:23:35] info: z2m: zigbee-herdsman started (resumed)
[2025-02-01 09:23:35] info: z2m: Coordinator firmware version: '{"meta":{"build":0,"ezsp":13,"major":7,"minor":4,"patch":5,"revision":"7.4.5 [GA]","special":0,"type":170},"type":"EmberZNet"}'
[2025-02-01 09:23:35] info: z2m: Currently 0 devices are joined.
[2025-02-01 09:23:35] info: z2m: Connecting to MQTT server at mqtt://172.17.0.4
[2025-02-01 09:23:35] info: z2m: Connected to MQTT server
[2025-02-01 09:23:35] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
[2025-02-01 09:23:35] info: z2m: Started frontend on port 8080
[2025-02-01 09:23:35] info: z2m: Zigbee2MQTT started!
[2025-02-01 10:23:35] info: zh:ember: [NCP COUNTERS] 0,1293,820,0,0,0,0,0,0,0,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[2025-02-01 10:23:35] info: zh:ember: [ASH COUNTERS] 348,73,35,37,0,0,0,0,385,37,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
This looks ok to me at least, no access to GUI, so how to pair devices and see output in HA?
The guides I see describe deploying z2m, and then using the GUI that I have no access to
What does ss -lntp on the host say?
You are not trying to access it via http://0.0.0.0:8080, right?
Yes, I was, I just tried the local HA address and :8080 and I got to the GUI π
If it looks like I'm bumbling around in the dark, I am
I enabled Join in there and it picked up a device by the looks of things
I was clicking on the link from Portainer, which defaulted to 0.0.0.0:8080
You can change that ip in the GUI.
Ok, thank you, it was confusing me, as if I needed more chaos π
Do "router" devices need to be configured to act as a router, or is that done automagically?
You mean like smart plugs and other things wired to mains? Those should function as mesh routers automatically
No. Either they are or they are not.
Thanks to all concerned..only have a few devices as yet but I can see the mesh forming in the map now