#MQTT Integration failure to connect

1 messages · Page 1 of 1 (latest)

tender harness
#

I have posted this issue on reddit here

Essentially, I have z2m and mosquitto running successfully in docker, but cannot connect to the mqtt integration in home assistant. Any help appreciated...

Docker Compose

`services:
zigbee2mqtt:
container_name: zigbee2mqtt
image: ghcr.io/koenkk/zigbee2mqtt
restart: unless-stopped
volumes:
- /volume1/docker/zigbee2mqtt:/app/data
ports:
- 8080:8080
environment:
- TZ=America/New_York

mosquitto:
container_name: mosquitto
image: eclipse-mosquitto:latest
restart: always

deploy:
  resources:
    limits:
      memory: 256M
ports:
  - "1883:1883"
  - "9001:9001"
volumes:
  - /localpath/mosquitto.conf:/mosquitto/config/mosquitto.conf
  - /localpath/data:/mosquitto/data
  - /localpath/log:/mosquitto/log`

Logs

Mosquitto

1771705170: mosquitto version 2.1.2 starting 1771705170: Config loaded from /mosquitto/config/mosquitto.conf. 1771705170: Bridge support available. 1771705170: Info: running mosquitto as user: mosquitto. 1771705170: Persistence support available. 1771705170: TLS support available. 1771705170: TLS-PSK support available. 1771705170: Websockets support available. 1771705170: Opening ipv4 listen socket on port 1883. 1771705170: mosquitto version 2.1.2 running 1771705170: New connection from 172.30.0.1:34336 on port 1883. 1771705170: New client connected from 172.30.0.1:34336 as mqttjs_eb23fbd0 (p4, c1, k60)

z2m

There is a lot, but it successfully connects to mqtt server, I see the device I paired.

[2026-02-21 15:17:53] info: z2m: Connecting to MQTT server at mqtt://192.168.1.10:1883 [2026-02-21 15:17:53] info: z2m: Connected to MQTT server [2026-02-21 15:17:53] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}' [2026-02-21 15:17:53] info: z2m: Started frontend on port 8080 [2026-02-21 15:17:53] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Temp - Jack Office', payload '{"battery":100,"humidity":24.8,"humidity_calibration":0,"linkquality":18,"temperature":22.5,"temperature_calibration":0,"update":{"installed_version":8704,"latest_release_notes":null,"latest_source":"https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/images/Sonoff/snzb-02p_v2.2.0.ota","latest_version":8704,"state":"idle"}}' [2026-02-21 15:17:53] info: z2m: Zigbee2MQTT started!

Integration

  • Broker - Server local IP
  • Port - 1883
  • User / Psw - Blank

Setup: HA running in VM on my NAS. Zigbee2MQTT and mosquitto running in docker. Docker compose services: zigbee2mqtt: container_name: zigbee2mqtt…

mystic aspen
#

My guess is that you haven't configured mosquitto to listen on all interfaces

tender harness
#

This is my conf file

`listener 1883 0.0.0.0
allow_anonymous true

log_dest stdout`

#

Should there be more things in the conf file @mystic aspen

polar hawk
#

Guessing 192.168 is local network, 172.30 is docker containers, I can't remember what the proper name is?

tender harness
#

That is correct

#

I also don’t know the proper name but from my limited understanding the 172.30 is docker specific

night atlas
#

What ip did you give HA exactly? What does ip a look like? What's in the HA log? Where is HA running on?

tender harness
#
  • HA ip is 192.168.1.159
  • Nothing in log
  • HA is running on VM on NAS
tender harness
tender harness
#

Alternatively if anyone has a guide for using slzb-06u for z2m with home assistant I am not opposed to starting over, this has been a nightmare

night atlas
polar hawk
#

Is docker also running on the nas?

night atlas
polar hawk
#

And what nas os?

tender harness
tender harness
tender harness
night atlas
#

Run ip a on the system that hosts it.

tender harness
night atlas
#

The ip assigned to your main NIC. You ain't. I am.

tender harness
#

Just to make sure I am doing this right, I ssh into nas, log in, then run ip a?

night atlas
#

If the nas runs mosquitto then yes.

night atlas
#

Should be 192.168.1.10. try these from the HA system

ping 192.168.1.10
nc -zv 192.168.1.10 1883
mosquitto_sub -v -h 192.168.1.10 -t "#"
tender harness
#

one second I somehow broke it so my zigbee2mqtt is not connecting anymore.

#

I should be sending these commands in the HA terminal right?

night atlas
#

Yeah.

tender harness
night atlas
#

Sorry, I edited above.

#

On the mosquitto system I'd also check ss -lntp | grep 1883.

tender harness
night atlas
#

Now just the last command. nc already tells the story though.

tender harness
night atlas
#

Yeah as expected. Check the ss command on the mosquitto side.

tender harness
#

ssh'ing one moment

night atlas
#

Looks good, although too cropped. What about ufw status?

tender harness
night atlas
#

Mosquitto.

mystic aspen
#

Is HA using the host network?

tender harness
#

command not found

#

HA is on VM

#

bridged networking

#

should I do iptables

night atlas
#

I see nothing wrong yet. You can run all these commands from earlier on the mosquitto server too but I expect them all to work.

tender harness
#

the ufw command isn't working, it might not be available on my nas

#

And yeah everything I did prior to making this thread checked out. No error messages until trying to get it to work with HA

night atlas
#

Your NAS might have its own firewall. You could also try MQTT Explorer from your own PC to test.

tender harness
#

Also if it matters I have a test device working in the localhost:8080 interface already

#

network setting on the HA VM

#

At this point should I just try integrating my z2m a different way

night atlas
#

HA can ping it at least.

tender harness
#

Just so I understand, everything is working it's just my HA VM cannot talk to my NAS for some reason?

#

am I just shit out of luck? I can't find anything online to try and get the vm to talk to nas

tender harness
#

That is the return when I run commands on nas (what is running mosquitto)

night atlas
#

Must be some kind of firewall between them then.

#

Can't think of much else at the moment.

tender harness
#

Where would I be looking for firewall details

#

Because in the UGOS I have it completely off, and even tried manually adding a rule to let HA in

night atlas
#

What OS is the VM using? Usually there are no default rules with most AFAIK.

tender harness
#

the VM is just running home assistant

night atlas
#

The mosquitto system I mean.

mystic aspen
#

it just seems like whatever VM you're using is messing with your bridge networking

tender harness
#

the NAS OS is UGOS

night atlas
#

Ah, right so it just runs docker directly.

tender harness
#

mosquitto is running on a docker container

#

let me shut down the HA VM and see if i can send the specs on the VM to you

#

I tried e1000 earlier

#

good fucking lord

#

I needed to adjust the bridge settings in the network connection section of the control panel

#

So in order to get the two to talk I needed to set LAN1 to be bridged

#

But I am pretty sure that fucks up everything else I run

mystic aspen
#

Should be fine

#

This is very typical

tender harness
#

Just as an example, it says my plex is now indirect

#

Should I connect both ports to router or something

night atlas
#

E1000E is generally a bad idea for linux. Google e1000e hang. What was it set to before and what is it now? I wonder why ping worked but mosquitto didn't 🤔

mystic aspen
#

A network bridge is like a software switch and is required if you want to host more than one host/ip on a single box with a single network adapter

tender harness
tender harness