Zigbee 2 MQTT on an external server

Hello! I am using Zigbee 2 MQTT on another server and MQ is installed on CHAOS. I would like to know how it is correct to specify a broker in Zigbee 2 MQTT in order for the added devices to appear immediately in Home Assistant.

You should be able to point Z2M to your :1883. You’ll also need to provide the username and password setup in the MQTT addon.

Your config should look like this:

mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.175:1883
  user: ha_mqtt
  password: 123412341234

I have tried that, but the new devices still do not appear in my HA.

Did you add the mqtt integration ?

1 Like

Have you looked at the MQTT logs or used something like the MQTT tool to see what traffic (if any) is being passed?


But there are no Zigbee 2 MQTT devices in the MQTT integration

Show your Zigbee2MQTT configuration. I use an external Zigbee2MQTT too, never had problems.

Having a similar issue. Using HAOS 14.1, Core 2025.1.2 on a Proxmox VM.

zigbee2mqtt refuses to start and complains:

[14:09:31] INFO: Preparing to start...
[14:09:31] INFO: Socat not enabled
[14:09:31] ERROR: Got unexpected response from the API: Service not enabled
[14:09:31] INFO: Starting Zigbee2MQTT...
Starting Zigbee2MQTT without watchdog.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            READ THIS CAREFULLY
Refusing to start because configuration is not valid, found the following errors:
-  must have required property 'mqtt'
If you don't know how to solve this, read https://www.zigbee2mqtt.io/guide/configuration
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

my config is

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://172.22.2.42:1883
  user: ha_mqtt
  password: 123412341234
serial:
  port: /dev/ttyUSB0

(The server does not resovle names for some reason, but well.) I had a zillion attempts, all showing the same error. My MQTT does not require username + password, but at least with mosquitto, I can safely add some random username and password and still receive events.

I can log in to the HA server via ssh.
I can subscribe to MQTT events with mosquitto_sub -h 172.22.2.42 -t "#" -v and receive the proper events.
I am very sure that the device ttyUSB0 is correct.

What’s wrong with my config??

At first glance, you’re missing socat in the first line, which causes an indentation error because of the other socat options in the first 5 lines.

Should be something like this:

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://172.22.2.42:1883
  user: ha_mqtt
  password: 123412341234
serial:
  port: /dev/ttyUSB0
1 Like

That’s odd. When I update my config accordingly and press ‘save’, the first 5 lines immediately reappear (the socat section is untouched):

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
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://172.22.2.42:1883
  user: ha_mqtt
  password: 123412341234
serial:
  port: /dev/ttyUSB0

Tried to find the yaml config file in the filesystem. The UI dialogue suggesteds /config/zigbee2mqtt.conf, but there is no such file but a zigbee2mqtt.db. And a /config/zigbee2mqtt/configuration.yaml which appears to be something else:

version: 4
homeassistant:
  enabled: true
advanced:
  network_key: GENERATE
  pan_id: GENERATE
  ext_pan_id: GENERATE

I guess, the config is stored inside the database.

Zigbee2MQTT version 2.1.1-1.

No, it should be stored in the /config/zigbee2mqtt/configuration.yaml you linked to.
What I suspect is happening is that Z2M is loading a backup of your old config and readding those lines.

There should be a hidden configuration.yaml.bk backup file in that path. Maybe try deleting that as a last resort.

Before you do, however, can you show a screenshot of your config tab in the Z2M addon? Obviously, hide the MQTT password before posting. I suspect you might have socat settings defined in both places.

1 Like

That’s it! You’re the pro! I was simply not recognizing, that the three text fields had the headings “socat”, “mqtt” and “serial”. This is the config now, z2m at least tries to start:

Now running into z2m issue #26255 but well… Was related to the USB hardware (Sonoff Zigbee 3.0 USB Dongle Plus (-E)) and fixed by adding adapter: ember to the serial section for more info, see Zigbee2MQTT 2.0.0 breaking changes · Koenkk/zigbee2mqtt · Discussion #24198 · GitHub.

Glad you got it sorted!

1 Like