Hi folks,
I’m trying to setup my Home Assistant with Zigbee and I’m at a loss for ideas why it won’t work.
History:
I’ve had HAOS running on my Pi3 incl. Zigbee2MQTT (Z2M) with ~8 devices. I then did a backup, installed HAOS on my Pi4 with SSD and did a recovery. Everything working great so far.
Now I’m trying to get Z2M back running as it was always just for fun, but I want to get more into it and remove my Chinese infrastructure Sadly, I cannot pair new devices, and the old one’s don’t work either. I removed Z2M and Mosquitto broker completely, restarted HAOS and started from scratch. Still won’t work after going through tutorials on the net.
I have a Sonoff stick, according to Amazon it’s a “D4F CC2531” (German page: https://www.amazon.de/gp/product/B09M475L3R).
I installed Mosquitto broker; according to tutorials, no configuration needed.
I then installed Zigbee2MQTT and looked up the port of the Zigbee stick. It seems to be “/dev/ttyACM0”:
So I added that in Zigbee2MQTT config:
I then started the Z2M addon and the log says that it started successfully, 0 devices joined, it’s connected and publishing to MQTT:
[21:32:37] INFO: Preparing to start...
[21:32:38] INFO: Socat not enabled
[21:32:40] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info 2023-10-16 21:32:46: Logging to console and directory: '/config/zigbee2mqtt/log/2023-10-16.21-32-46' filename: log.txt
Zigbee2MQTT:info 2023-10-16 21:32:46: Starting Zigbee2MQTT version 1.33.1 (commit #unknown)
Zigbee2MQTT:info 2023-10-16 21:32:46: Starting zigbee-herdsman (0.19.0)
Zigbee2MQTT:info 2023-10-16 21:32:47: zigbee-herdsman started (resumed)
Zigbee2MQTT:info 2023-10-16 21:32:47: Coordinator firmware version: '{"meta":{"maintrel":3,"majorrel":2,"minorrel":6,"product":0,"revision":20211115,"transportrev":2},"type":"zStack12"}'
Zigbee2MQTT:info 2023-10-16 21:32:47: Currently 0 devices are joined:
Zigbee2MQTT:info 2023-10-16 21:32:47: Zigbee: disabling joining new devices.
Zigbee2MQTT:info 2023-10-16 21:32:47: Connecting to MQTT server at mqtt://core-mosquitto:1883
Zigbee2MQTT:info 2023-10-16 21:32:47: Connected to MQTT server
Zigbee2MQTT:info 2023-10-16 21:32:47: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
Zigbee2MQTT:info 2023-10-16 21:32:47: Started frontend on port 0.0.0.0:8099
Zigbee2MQTT:info 2023-10-16 21:32:47: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"commit":"unknown","coordinator":{"meta":{"maintrel":3,"majorrel":2,"minorrel":6,"product":0,"revision":20211115,"transportrev":2},"type":"zStack12"},"log_level":"info","network":{"channel":11,"extendedPanID":"0x00124b001cdcebda","panID":6754},"permit_join":false,"version":"1.33.1"}'
Zigbee2MQTT:info 2023-10-16 21:32:47: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
Zigbee2MQTT:info 2023-10-16 21:32:47: Zigbee2MQTT started!
Zigbee2MQTT:info 2023-10-16 21:34:00: Zigbee: allowing new devices to join.
Zigbee2MQTT:info 2023-10-16 21:34:00: MQTT publish: topic 'zigbee2mqtt/bridge/response/permit_join', payload '{"data":{"time":254,"value":true},"status":"ok","transaction":"yw9de-1"}'
Zigbee2MQTT:info 2023-10-16 21:50:30: Zigbee: allowing new devices to join.
Zigbee2MQTT:info 2023-10-16 21:50:30: MQTT publish: topic 'zigbee2mqtt/bridge/response/permit_join', payload '{"data":{"time":254,"value":true},"status":"ok","transaction":"ihjwi-1"}'
Mosquitto log looks ok to me, but not 100% sure:
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/mosquitto.sh
[21:30:07] INFO: Certificates found: SSL is available
cont-init: info: /etc/cont-init.d/mosquitto.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun mosquitto (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
[21:30:08] INFO: Starting NGINX for authentication handling...
s6-rc: info: service legacy-services successfully started
[21:30:09] INFO: Starting mosquitto MQTT broker...
2023-10-16 21:30:09: Warning: Mosquitto should not be run as root/administrator.
2023-10-16 21:30:09: mosquitto version 2.0.17 starting
2023-10-16 21:30:09: Config loaded from /etc/mosquitto/mosquitto.conf.
2023-10-16 21:30:09: Loading plugin: /usr/share/mosquitto/go-auth.so
2023-10-16 21:30:09: ├── Username/password checking enabled.
2023-10-16 21:30:09: ├── TLS-PSK checking enabled.
2023-10-16 21:30:09: └── Extended authentication not enabled.
2023-10-16 21:30:09: Opening ipv4 listen socket on port 1883.
2023-10-16 21:30:09: Opening ipv6 listen socket on port 1883.
2023-10-16 21:30:09: Opening websockets listen socket on port 1884.
2023-10-16 21:30:09: Opening ipv4 listen socket on port 8883.
2023-10-16 21:30:09: Opening ipv6 listen socket on port 8883.
2023-10-16 21:30:09: Opening websockets listen socket on port 8884.
2023-10-16 21:30:09: mosquitto version 2.0.17 running
2023-10-16 21:30:09: New connection from 127.0.0.1:35510 on port 1883.
2023-10-16 21:30:09: Client <unknown> disconnected due to protocol error.
[21:30:10] INFO: Successfully send discovery information to Home Assistant.
[21:30:11] INFO: Successfully send service information to the Supervisor.
2023-10-16 21:30:39: New connection from 172.30.33.5:37972 on port 1883.
2023-10-16 21:30:39: New client connected from 172.30.33.5:37972 as mqttjs_ffc901e9 (p2, c1, k60, u'addons').
2023-10-16 21:30:41: Client mqttjs_ffc901e9 disconnected.
2023-10-16 21:30:54: New connection from 172.30.33.5:58242 on port 1883.
2023-10-16 21:30:54: New client connected from 172.30.33.5:58242 as mqttjs_3da95901 (p2, c1, k60, u'addons').
2023-10-16 21:31:10: New connection from 172.30.32.1:44992 on port 1883.
2023-10-16 21:31:10: New client connected from 172.30.32.1:44992 as 0Fl57E4MxDscMyJfpWyr8u (p2, c1, k60, u'mqtt-user').
2023-10-16 21:31:45: New connection from 172.30.32.2:53180 on port 1883.
2023-10-16 21:31:45: Client <unknown> closed its connection.
2023-10-16 21:32:35: Client mqttjs_3da95901 disconnected.
2023-10-16 21:32:47: New connection from 172.30.33.5:41208 on port 1883.
2023-10-16 21:32:47: New client connected from 172.30.33.5:41208 as mqttjs_a5902a9a (p2, c1, k60, u'addons').
2023-10-16 21:33:45: New connection from 172.30.32.2:51502 on port 1883.
2023-10-16 21:33:45: Client <unknown> closed its connection.
2023-10-16 21:35:45: New connection from 172.30.32.2:57266 on port 1883.
2023-10-16 21:35:45: Client <unknown> closed its connection.
2023-10-16 21:37:45: New connection from 172.30.32.2:34612 on port 1883.
2023-10-16 21:37:45: Client <unknown> closed its connection.
2023-10-16 21:39:45: New connection from 172.30.32.2:43060 on port 1883.
2023-10-16 21:39:45: Client <unknown> closed its connection.
2023-10-16 21:41:45: New connection from 172.30.32.2:60632 on port 1883.
2023-10-16 21:41:45: Client <unknown> closed its connection.
2023-10-16 21:43:45: New connection from 172.30.32.2:47586 on port 1883.
2023-10-16 21:43:45: Client <unknown> closed its connection.
2023-10-16 21:45:45: New connection from 172.30.32.2:43660 on port 1883.
2023-10-16 21:45:45: Client <unknown> closed its connection.
2023-10-16 21:47:45: New connection from 172.30.32.2:37450 on port 1883.
2023-10-16 21:47:45: Client <unknown> closed its connection.
2023-10-16 21:49:45: New connection from 172.30.32.2:53128 on port 1883.
2023-10-16 21:49:45: Client <unknown> closed its connection.
2023-10-16 21:51:45: New connection from 172.30.32.2:50962 on port 1883.
2023-10-16 21:51:45: Client <unknown> closed its connection.
What’s odd to me, is that the new connection on port 1883 is closed immediately. I don’t know if that’s supposed to be like that.
Ok, so that’s the config. I then went to Z2M, started listening for devices, and tried paring the following:
- PIR movement sensor (Sonoff)
- water leak sensor (Aqara)
- light switch (Ikea)
- Button (Aqara)
- Door/window sensor (open/close, Sonoff)
None of these were found, and I tried twice with all of them.
Does anyone have a clue what is going on here, and how I can troubleshoot this? Did I miss something? I remember in one video, they said that you should set a username/password for MQTT, but other pages said it’s unnecessary, so I left that out. I’m also wondering why the Z2M config does not require a MQTT configuration.
I’m looking forward to your responses! <3
<UPDATE>
I plugged in my old Pi with the mentioned stick and all the Zigbee devices appear to still be working with that one …
Here’s the Mosquitto log: (I did an nmap scan from 192.168.3.13, so you can ignore that)
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/mosquitto.sh
[21:25:04] INFO: Certificates found: SSL is available
cont-init: info: /etc/cont-init.d/mosquitto.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun mosquitto (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
s6-rc: info: service legacy-services successfully started
[21:25:09] INFO: Starting NGINX for authentication handling...
[21:25:09] INFO: Starting mosquitto MQTT broker...
2023-10-17 21:25:09: Warning: Mosquitto should not be run as root/administrator.
2023-10-17 21:25:09: mosquitto version 2.0.17 starting
2023-10-17 21:25:09: Config loaded from /etc/mosquitto/mosquitto.conf.
2023-10-17 21:25:09: Loading plugin: /usr/share/mosquitto/go-auth.so
2023-10-17 21:25:09: ├── Username/password checking enabled.
2023-10-17 21:25:09: ├── TLS-PSK checking enabled.
2023-10-17 21:25:09: └── Extended authentication not enabled.
2023-10-17 21:25:09: Opening ipv4 listen socket on port 1883.
2023-10-17 21:25:09: Opening ipv6 listen socket on port 1883.
2023-10-17 21:25:09: Opening websockets listen socket on port 1884.
2023-10-17 21:25:09: Opening ipv4 listen socket on port 8883.
2023-10-17 21:25:09: Opening ipv6 listen socket on port 8883.
2023-10-17 21:25:09: Opening websockets listen socket on port 8884.
2023-10-17 21:25:09: mosquitto version 2.0.17 running
2023-10-17 21:25:12: New connection from 127.0.0.1:46732 on port 1883.
2023-10-17 21:25:12: Client <unknown> disconnected due to protocol error.
[21:25:17] INFO: Successfully send discovery information to Home Assistant.
[21:25:19] INFO: Successfully send service information to the Supervisor.
2023-10-17 21:25:58: New connection from 192.168.3.13:9778 on port 8883.
2023-10-17 21:25:58: New connection from 192.168.3.13:9774 on port 1883.
error: received null username or password for unpwd check
2023-10-17 21:26:04: Client nmap disconnected, not authorised.
2023-10-17 21:26:04: OpenSSL Error[0]: error:1408F09C:SSL routines:ssl3_get_record:http request
2023-10-17 21:26:04: Client <unknown> disconnected: Protocol error.
2023-10-17 21:26:04: New connection from 192.168.3.13:9782 on port 8883.
2023-10-17 21:26:04: OpenSSL Error[0]: error:1420918C:SSL routines:tls_early_post_process_client_hello:version too low
2023-10-17 21:26:04: Client <unknown> disconnected: Protocol error.
2023-10-17 21:26:04: New connection from 192.168.3.13:9785 on port 8883.
error: received null username or password for unpwd check
2023-10-17 21:26:10: Client nmap disconnected, not authorised.
2023-10-17 21:28:04: New connection from 172.30.32.1:35024 on port 1883.
2023-10-17 21:28:04: New client connected from 172.30.32.1:35024 as 5i99acm9YGZm3F9P09GG1N (p2, c1, k60, u'mqtt-user').
2023-10-17 21:28:19: New connection from 192.168.3.13:9916 on port 1883.
2023-10-17 21:28:19: New connection from 192.168.3.13:9917 on port 8883.
error: received null username or password for unpwd check
2023-10-17 21:28:20: Client nmapnzktqzdlqlsqvohe disconnected, not authorised.
error: received null username or password for unpwd check
2023-10-17 21:28:20: Client nmapuynuhrrdsigazzor disconnected, not authorised.
2023-10-17 21:29:54: New connection from 192.168.3.13:9933 on port 1883.
2023-10-17 21:29:55: New connection from 192.168.3.13:9938 on port 8883.
error: received null username or password for unpwd check
2023-10-17 21:30:00: Client nmap disconnected, not authorised.
2023-10-17 21:30:01: OpenSSL Error[0]: error:1408F09C:SSL routines:ssl3_get_record:http request
2023-10-17 21:30:01: Client <unknown> disconnected: Protocol error.
2023-10-17 21:30:01: Client connection from 192.168.3.13 failed: error:1420918C:SSL routines:tls_early_post_process_client_hello:version too low.
2023-10-17 21:30:01: New connection from 192.168.3.13:9958 on port 8883.
2023-10-17 21:30:04: New connection from 172.30.33.5:53904 on port 1883.
2023-10-17 21:30:04: New client connected from 172.30.33.5:53904 as mqttjs_654efa35 (p2, c1, k60, u'mqtt-user').
error: received null username or password for unpwd check
2023-10-17 21:30:07: Client nmap disconnected, not authorised.
2023-10-17 21:32:16: New connection from 192.168.3.13:10117 on port 8883.
2023-10-17 21:32:16: New connection from 192.168.3.13:10118 on port 1883.
error: received null username or password for unpwd check
2023-10-17 21:32:16: Client nmapkefllrpxlrtcndyd disconnected, not authorised.
error: received null username or password for unpwd check
2023-10-17 21:32:16: Client nmapdvzzacofykwsmegq disconnected, not authorised.
It seems like there are no disconnects like before, so I’m wondering if that might be the issue here.
Any idea how I can purge all Mosquitto and Z2M config?