Zigbee2MQTT Ingress error: Cannot connect to host 172.30.33.1:8099 ssl:default [Connect call failed ('172.30.33.1', 8099)]

Hi All,

I am new to HA and zigbee2mqtt and this is my first time setting up.

I am currently using HA on raspberry pi 5 and Sonoff ZBDongle-P as my zigbee coordinator

I have followed the online tutorials to flash my zigbee dongle using python. (CC1352P2_CC2652P_launchpad_coordinator_20230507.hex)

However, when setting up zigbee2MQTT in HA, i keep getting the error message that the connection failed. Ingress error: Cannot connect to host 172.30.33.1:8099 ssl:default [Connect call failed (‘172.30.33.1’, 8099)]

Below are my configurations:

  1. Mosquitto
logins:
  - username: mqtt_user
    password: mqtt_pass
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: false
  folder: mosquitto
  1. Zigbee2MQTT
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: true
mqtt:
  server: mqtt://core-mosquitto:1883
  user: mqtt_user
  password: mqtt_pass
serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_8e9dc266ada4ed11a71cf3a32981d5c7-if00-port0

Logs - Zigbee2MQTT

[14:25:51] INFO: Preparing to start...
[14:25:51] INFO: Socat not enabled
[14:25:52] INFO: Starting Zigbee2MQTT...
[2024-05-02 14:25:53] info: 	z2m: Logging to console, file (filename: log.log)
[2024-05-02 14:25:54] info: 	z2m: Starting Zigbee2MQTT version 1.37.0 (commit #unknown)
[2024-05-02 14:25:54] info: 	z2m: Starting zigbee-herdsman (0.45.0)
[2024-05-02 14:25:54] info: 	zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_8e9dc266ada4ed11a71cf3a32981d5c7-if00-port0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2024-05-02 14:25:54] info: 	zh:zstack:znp: Serialport opened
[2024-05-02 14:25:54] info: 	z2m: zigbee-herdsman started (resumed)
[2024-05-02 14:25:54] info: 	z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20230507,"transportrev":2},"type":"zStack3x0"}'
[2024-05-02 14:25:54] info: 	z2m: Currently 0 devices are joined:
[2024-05-02 14:25:54] info: 	z2m: Zigbee: disabling joining new devices.
[2024-05-02 14:25:55] info: 	z2m: Connecting to MQTT server at mqtt://core-mosquitto:1883
[2024-05-02 14:25:55] error: 	z2m: MQTT failed to connect, exiting...
[2024-05-02 14:25:55] info: 	z2m: Stopping zigbee-herdsman...
[2024-05-02 14:26:03] info: 	zh:controller: Wrote coordinator backup to '/config/zigbee2mqtt/coordinator_backup.json'
[2024-05-02 14:26:03] info: 	zh:zstack:znp: closing
[2024-05-02 14:26:03] info: 	zh:zstack:znp: Port closed
[2024-05-02 14:26:03] info: 	z2m: Stopped zigbee-herdsman

Logs - HA supervisor

2024-05-02 14:23:59.209 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on zigbee2mqtt/zigbee2mqtt-aarch64 with version 1.37.0-1
2024-05-02 14:23:59.232 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.1:8099 ssl:default [Connect call failed ('172.30.33.1', 8099)]
2024-05-02 14:25:50.943 INFO (SyncWorker_5) [supervisor.docker.manager] Cleaning addon_45df7312_zigbee2mqtt application
2024-05-02 14:25:51.498 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on zigbee2mqtt/zigbee2mqtt-aarch64 with version 1.37.0-1

Please let me know if i missed out any information for troubleshooting.

Would appreciate any inputs. Cheers~

Have you set up and started MQTT (Mosquitto?)

Yes, mosquitto broker is active

2024-05-02 14:55:55: New connection from 172.30.32.2:47992 on port 1883.
2024-05-02 14:55:55: Client <unknown> closed its connection.
2024-05-02 14:57:55: New connection from 172.30.32.2:36480 on port 1883.
2024-05-02 14:57:55: Client <unknown> closed its connection.
2024-05-02 14:59:55: New connection from 172.30.32.2:52806 on port 1883.
2024-05-02 14:59:55: Client <unknown> closed its connection.

I have also tried to remove the server settings in zigbee2mqtt but the issue still persists:

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: true
mqtt: {}
serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_8e9dc266ada4ed11a71cf3a32981d5c7-if00-port0

Logs

[15:27:31] INFO: Preparing to start...
[15:27:31] INFO: Socat not enabled
[15:27:32] INFO: Starting Zigbee2MQTT...
[2024-05-02 15:27:32] info: 	z2m: Logging to console, file (filename: log.log)
[2024-05-02 15:27:33] info: 	z2m: Starting Zigbee2MQTT version 1.37.0 (commit #unknown)
[2024-05-02 15:27:33] info: 	z2m: Starting zigbee-herdsman (0.45.0)
[2024-05-02 15:27:34] info: 	zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_8e9dc266ada4ed11a71cf3a32981d5c7-if00-port0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2024-05-02 15:27:34] info: 	zh:zstack:znp: Serialport opened
[2024-05-02 15:27:34] info: 	z2m: zigbee-herdsman started (resumed)
[2024-05-02 15:27:34] info: 	z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20230507,"transportrev":2},"type":"zStack3x0"}'
[2024-05-02 15:27:34] info: 	z2m: Currently 0 devices are joined:
[2024-05-02 15:27:34] info: 	z2m: Zigbee: disabling joining new devices.
[2024-05-02 15:27:34] info: 	z2m: Connecting to MQTT server at mqtt://core-mosquitto:1883
[2024-05-02 15:27:34] error: 	z2m: MQTT failed to connect, exiting...
[2024-05-02 15:27:34] info: 	z2m: Stopping zigbee-herdsman...
[2024-05-02 15:27:42] info: 	zh:controller: Wrote coordinator backup to '/config/zigbee2mqtt/coordinator_backup.json'
[2024-05-02 15:27:42] info: 	zh:zstack:znp: closing
[2024-05-02 15:27:42] info: 	zh:zstack:znp: Port closed
[2024-05-02 15:27:42] info: 	z2m: Stopped zigbee-herdsman

Can you connect with MQTT Explorer?

Sorry @fleskefjes, i am not familiar with MQTT explorer.

Is this an add-on i install on HA?

It is a desktop program. See the link fleskefjes posted.

Can I check what to enter for the config?

I tried the following settings:

  1. mqtt://127.0.0.1 port 1883 and
  2. mqtt://test-mosquitto.org port 1883

both prompts me “disconnected from server”

mqtt://ip of HA:1883
username and password you tried for Zigbee2MQTT

I managed to connect using the above config:

mqtt explorer_2

I noticed my homeassistant status = offline.

What other settings should I be looking at?

Try these settings now in the Zigbee2MQTT configuration.

hi @francisp , same error in zigbee2mqtt:

zigbee2mqtt logs

[2024-05-02 17:41:18] info: 	z2m: Currently 0 devices are joined:
[2024-05-02 17:41:18] info: 	z2m: Zigbee: disabling joining new devices.
[2024-05-02 17:41:18] info: 	z2m: Connecting to MQTT server at mqtt://192.168.2.125:1883
[2024-05-02 17:41:18] error: 	z2m: MQTT failed to connect, exiting...
[2024-05-02 17:41:18] info: 	z2m: Stopping zigbee-herdsman...
[2024-05-02 17:41:26] info: 	zh:controller: Wrote coordinator backup to '/config/zigbee2mqtt/coordinator_backup.json'
[2024-05-02 17:41:26] info: 	zh:zstack:znp: closing
[2024-05-02 17:41:26] info: 	zh:zstack:znp: Port closed
[2024-05-02 17:41:26] info: 	z2m: Stopped zigbee-herdsman

HA supervisor logs

2024-05-02 17:41:14.221 INFO (SyncWorker_7) [supervisor.docker.manager] Cleaning addon_45df7312_zigbee2mqtt application
2024-05-02 17:41:14.763 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on zigbee2mqtt/zigbee2mqtt-aarch64 with version 1.37.0-1
2024-05-02 17:41:14.810 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.1:8099 ssl:default [Connect call failed ('172.30.33.1', 8099)]

This is a shot in the dark, but I think I remember having issues with special characters in the MQTT password.

try removing the _ in password: mqtt_pass and username:mqtt_user

Thanks for your inputs.

I tried but it didnt work:
Moquitto broker config:

logins:
  - username: mqttuser
    password: mqttpass
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: false
  folder: mosquitto

Mosquitto broker log:

2024-05-02 18:57:48: New connection from 172.30.32.1:35373 on port 1883.
2024-05-02 18:57:48: New client connected from 172.30.32.1:35373 as 2PXryysazGbOQv5Te2Zl0W (p2, c1, k60, u'mqttuser').
2024-05-02 18:57:48: New connection from 172.30.32.1:40345 on port 1883.
2024-05-02 18:57:48: New client connected from 172.30.32.1:40345 as 3hb3h3TUJb6u96jiqljKpe (p2, c1, k60, u'mqttuser').
2024-05-02 18:58:25: New connection from 192.168.2.150:57658 on port 1883.
2024-05-02 18:58:25: New client connected from 192.168.2.150:57658 as mqtt-explorer-4d50e13c (p2, c1, k60, u'mqttuser').
2024-05-02 18:58:41: Client mqtt-explorer-4d50e13c disconnected.

Zigbee2MQTT log:

[18:58:10] INFO: Preparing to start...
[18:58:10] INFO: Socat not enabled
[18:58:11] INFO: Starting Zigbee2MQTT...
[2024-05-02 18:58:11] info: 	z2m: Logging to console, file (filename: log.log)
[2024-05-02 18:58:13] info: 	z2m: Starting Zigbee2MQTT version 1.37.0 (commit #unknown)
[2024-05-02 18:58:13] info: 	z2m: Starting zigbee-herdsman (0.45.0)
[2024-05-02 18:58:13] info: 	zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_8e9dc266ada4ed11a71cf3a32981d5c7-if00-port0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2024-05-02 18:58:13] info: 	zh:zstack:znp: Serialport opened
[2024-05-02 18:58:13] info: 	z2m: zigbee-herdsman started (resumed)
[2024-05-02 18:58:13] info: 	z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20230507,"transportrev":2},"type":"zStack3x0"}'
[2024-05-02 18:58:13] info: 	z2m: Currently 0 devices are joined:
[2024-05-02 18:58:13] info: 	z2m: Zigbee: disabling joining new devices.
[2024-05-02 18:58:13] info: 	z2m: Connecting to MQTT server at mqtt://192.168.2.125:1883
[2024-05-02 18:58:13] error: 	z2m: MQTT failed to connect, exiting...
[2024-05-02 18:58:13] info: 	z2m: Stopping zigbee-herdsman...
[2024-05-02 18:58:21] info: 	zh:controller: Wrote coordinator backup to '/config/zigbee2mqtt/coordinator_backup.json'
[2024-05-02 18:58:21] info: 	zh:zstack:znp: closing
[2024-05-02 18:58:21] info: 	zh:zstack:znp: Port closed
[2024-05-02 18:58:21] info: 	z2m: Stopped zigbee-herdsman

MQTT explorer able to connect with the new user/password and mqtt://ipaddress

My MQTT Broker’s configuration doesn’t contain usernames and passwords in the logins section. It uses Home Assistant’s Users for authentication.

A list of local users that will be created with username and password. You don’t need to do this because you can use Home Assistant users too, without any configuration. You can also specify password_pre_hashed: true to utilize a pre-hashed password from the output of the pw command (which is present inside the container).

Change this:

logins:
  - username: mqttuser
    password: mqttpass

To this then save and restart MQTT Broker.

logins: []

My Zigbee2MQTT Addon automatically used a default addon account to connect to the MQTT Broker (i.e. I didn’t manually configure it).

To allow MQTT Explorer to connect to MQTT Broker, go to Settings → People → Users and create a User account for it (not a Person account). Assign the new User account whatever username and password you want and then configure MQTT Explorer to use it.

thanks for your inputs. I am only able to add “People”. Am i missing something?

  1. Ensure your account has Administrator privileges.
  2. Ensure Advanced Mode is enabled.

This setting is found by clicking on your user icon located at the lower left of the main UI (i.e. at the very bottom of the main menu on the left side).

Okay, the connection still failed after changing the user settings.

Mosquitto Config:

logins: []
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: false
  folder: mosquitto

User Screen

Supervisor logs:

2024-05-02 21:26:07.944 INFO (MainThread) [supervisor.auth] Auth request from 'core_mosquitto' for 'mqttuser'
2024-05-02 21:26:08.234 INFO (MainThread) [supervisor.auth] Successful login for 'mqttuser'
2024-05-02 21:27:22.501 INFO (SyncWorker_5) [supervisor.docker.manager] Cleaning addon_45df7312_zigbee2mqtt application
2024-05-02 21:27:23.039 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on zigbee2mqtt/zigbee2mqtt-aarch64 with version 1.37.0-1
2024-05-02 21:27:48.406 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
2024-05-02 21:30:03.885 INFO (SyncWorker_0) [supervisor.docker.manager] Cleaning addon_45df7312_zigbee2mqtt application
2024-05-02 21:30:04.414 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on zigbee2mqtt/zigbee2mqtt-aarch64 with version 1.37.0-1
2024-05-02 21:30:04.438 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.1:8099 ssl:default [Connect call failed ('172.30.33.1', 8099)]
2024-05-02 21:30:07.251 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.1:8099 ssl:default [Connect call failed ('172.30.33.1', 8099)]

Here’s the Configuration page for my Zigbee2MQTT Addon. Notice that the mqtt section is blank.

However, if I examine the Zigbee2MQTT Addon’s configuration.yaml file, it auto-populated the mqtt section.

Thank you for your patience with me, but how do i achieve that?

If i were to remove the server settings, it doesnt appear when i edit in yaml. Am i missing something?

Current zigbee2mqtt config (yaml):

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-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_8e9dc266ada4ed11a71cf3a32981d5c7-if00-port0

UI edit

File-Editor → Zigbee2MQTT → Configuration.yaml