SkyConnect vs Zigbee2MQTT

Hello everyone,

I’m new to HA and just set up my first system on a nuc. After my first attempts with ZHA I recognized some issues like not showing battery status on some of my Aqara E1 Thermostats so that I decided to test Zigbee2MQTT. I literally watched hours on youtube on how to set up Zigbee2MQTT but there are just a minor numbers of dealing with SkyConnect. The problem is that I’m unable to get z2m to run using SkyConnect.

So here are the steps I’ve done so far:

  • fresh installation of HA:
    (Home Assistant 2023.2.3 Supervisor 2023.01.1 Operating System 9.5 Frontend 20230202.0 - latest)
  • SkyConnect is connected via extension cable that it comes with in the box and is connected due to a lack of missing USB 2.0 ports on a NUC8 to a USB 3.0 port
  • setting HA into advanced mode
  • installing mosquitto-broker add-on
  • rebooting system
  • creating an user for mqtt with local access only
  • configuring core-mosquitto MQTT integration with the created user information and is working
  • adding repo from official z2m source
  • installing zigbee2mqtt
  • checking hardware information for serial port
  • adding port info and adapter to ezsp under serial configuration in the z2m add-on

configuration.yaml in the add-on states:

socat:
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: false
mqtt: {}
serial:
  port: >-
    /dev/serial/by-id/usb-Nabu_Casa_SkyConnect_v1.0_e45b1159af57ed11ae724aca5720eef3-if00-port0
  adapter: ezsp

The strange thing is that when looking via file editor into the folder directory /config/zigbee2mqtt/configuration.yaml there is nothing in it than just:

homeassistant: true

So even when the official documentation says that when using mosquitto-broker no mqtt information are required I also tried to set the information for mqtt like:

base_topic: zigbee2mqtt
server: mqtt://localhost:1883 -> also tried homeassistant:1883
username: mqttuser -> created after installing mosquitto add-on
password: password for mqttuser -> same

but with no difference. The log states always states:

[12:38:43] INFO: Preparing to start...
[12:38:43] INFO: Socat not enabled
[12:38:43] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2023-02-10 12:38:44: Logging to console and directory: '/config/zigbee2mqtt/log/2023-02-10.12-38-44' filename: log.txt
Zigbee2MQTT:info  2023-02-10 12:38:44: Starting Zigbee2MQTT version 1.30.1 (commit #unknown)
Zigbee2MQTT:info  2023-02-10 12:38:44: Starting zigbee-herdsman (0.14.89)
Zigbee2MQTT:error 2023-02-10 12:39:04: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-02-10 12:39:04: Failed to start zigbee
Zigbee2MQTT:error 2023-02-10 12:39:04: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2023-02-10 12:39:04: Exiting...
Zigbee2MQTT:error 2023-02-10 12:39:05: Error: Connection not initialized
    at Ezsp.execCommand (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:518:19)
    at Ezsp.version (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:325:35)
    at Driver.startup (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/driver.ts:141:25)
    at EZSPAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/adapter/ezspAdapter.ts:165:16)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
    at Zigbee.start (/app/lib/zigbee.ts:58:27)
    at Controller.start (/app/lib/controller.ts:101:27)
    at start (/app/index.js:107:5)

I recognized the Error code

Zigbee2MQTT:error 2023-02-10 12:39:05: Error: Connection not initialized

but I don’t know how to initialize the connection correctly?

Does anyone has an advice on how to set it up and get it run?

Thanks in advance.

I just did this same thing, here’s my config. Hard to see if there’s any difference on the phone.

data_path: /config/zigbee2mqtt
socat:
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: false
mqtt: {}
serial:
  port: >-
    /dev/serial/by-id/usb-Nabu_Casa_SkyConnect_v1.0_e2fb75ab575aed11b9cfed165820eef3-if00-port0
  adapter: ezsp

I made the mistake of not disabling ZHA initially and I flashed the firmware to the latest - 1.1.4.0 I think.

Thanks for your response.

I followed your hints and flashed SkyConnect via skyconnect.home-assistant.io and updated it to the latest firmware choosing Zigbee only.

Afterwards I reconnected it and restartet the whole system. I checked that all integrations using ZHA are really disabled and reinstalled z2m - but no luck at all.

So updating the /config/zigbee2mqtt/configuration.yaml to:

data_path: /config/zigbee2mqtt
socat:
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://core-mosquitto:1883
  user: mqttuser
  password: pass
serial:
  port: /dev/serial/by-id/usb-Nabu_Casa_SkyConnect_v1.0_e45b1159af57ed11ae724aca5720eef3-if00-port0
  adapter: ezsp
homeassistant: true
permit_join: false
frontend: true
advanced:
  log_level: debug
zigbee_herdsman_debug: true

The logs states:

[14:09:39] INFO: Preparing to start...
[14:09:40] INFO: Socat not enabled
[14:09:40] INFO: Zigbee Herdsman debug logging enabled
[14:09:40] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:debug 2023-02-11 14:09:41: Loaded state from file /config/zigbee2mqtt/state.json
Zigbee2MQTT:info  2023-02-11 14:09:41: Logging to console and directory: '/config/zigbee2mqtt/log/2023-02-11.14-09-41' filename: log.txt
Zigbee2MQTT:debug 2023-02-11 14:09:41: Removing old log directory '/config/zigbee2mqtt/log/2023-02-11.13-12-44'
Zigbee2MQTT:info  2023-02-11 14:09:41: Starting Zigbee2MQTT version 1.30.1 (commit #unknown)
Zigbee2MQTT:info  2023-02-11 14:09:41: Starting zigbee-herdsman (0.14.89)
Zigbee2MQTT:debug 2023-02-11 14:09:41: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/config/zigbee2mqtt/coordinator_backup.json","databaseBackupPath":"/config/zigbee2mqtt/database.db.backup","databasePath":"/config/zigbee2mqtt/database.db","network":{"channelList":[11],"extendedPanID":[221,221,221,221,221,221,221,221],"networkKey":"HIDDEN","panID":6754},"serialPort":{"adapter":"ezsp","path":"/dev/serial/by-id/usb-Nabu_Casa_SkyConnect_v1.0_e45b1159af57ed11ae724aca5720eef3-if00-port0"}}'
2023-02-11T13:09:41.670Z zigbee-herdsman:adapter Failed to validate path: 'Error: spawn udevadm ENOENT'
2023-02-11T13:09:41.670Z zigbee-herdsman:controller:log Starting with options '{"network":{"networkKeyDistribute":false,"networkKey":[1,3,5,7,9,11,13,15,0,2,4,6,8,10,12,13],"panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channelList":[11]},"serialPort":{"path":"/dev/serial/by-id/usb-Nabu_Casa_SkyConnect_v1.0_e45b1159af57ed11ae724aca5720eef3-if00-port0","adapter":"ezsp"},"databasePath":"/config/zigbee2mqtt/database.db","databaseBackupPath":"/config/zigbee2mqtt/database.db.backup","backupPath":"/config/zigbee2mqtt/coordinator_backup.json","adapter":{"disableLED":false,"concurrent":null,"delay":null}}'
2023-02-11T13:09:41.672Z zigbee-herdsman:adapter:ezsp:uart Opening SerialPort with {"path":"/dev/serial/by-id/usb-Nabu_Casa_SkyConnect_v1.0_e45b1159af57ed11ae724aca5720eef3-if00-port0","baudRate":115200,"rtscts":false,"autoOpen":false}
2023-02-11T13:09:41.676Z zigbee-herdsman:adapter:ezsp:uart Serialport opened
2023-02-11T13:09:41.676Z zigbee-herdsman:adapter:ezsp:uart Uart reseting
2023-02-11T13:09:41.676Z zigbee-herdsman:adapter:ezsp:uart --> Write reset
2023-02-11T13:09:41.677Z zigbee-herdsman:adapter:ezsp:uart --> [1ac038bc7e]
Zigbee2MQTT:debug 2023-02-11 14:14:41: Saving state to file /config/zigbee2mqtt/state.json

It stucks at starting zigbee-herdsman.

Hi, it should be firmware on skyconnect. This is typical issue on ezsp