Zigbee2MQTT does not show up - Docker setup, Docker-GUI available

Hardware: FriendlyElec Nanopi R5S with 1TB SSD installed locally. Sonoff ZBDongle-P with latest formware, used to work perfectly in HAOS setup
Software: FriendlyWRT/OpenWRT with Docker CE

First step: Mount, partition, format the NVME and map it in etc/fstab as media/nvme. SSD works fine.
Second step: Install HA Container, works like a charm. Sonoff stick shows up, all fine. Just I need Zigbee2MQTT for several things.
Third step: Installing Zigbee2MQTT as separate containers, so my expectation were 3 containers: HA, Z2M and Mosquitto.

First I set my Docker dir to the SSD, i.e. to media/nvme

Looks all good

image

Set up directories

image

docker-compose.yml:

within zigbee2mqtt-data

image

image

which is consistent with what my GUI tells me

But hey: It killed HA! o.k., lets handle HA later, check if Zigbee2MQTT is running, but
http://localhost:8080/ is giving me
ERR_CONNECTION_REFUSED

What did I miss? Does HA need to run in order to get Z2M running? Do I have to build bridged between the Docker containers? Expose Z2M? Would it be better to install through the Docker-Install-GUI?


(options continue below)

You missed telling Z2M to use port 1883 for MQTT

You also shared all the text as images, not as text as explained in here.

1 Like

Thanks for the advice and sorry for not posting as text - I really tried but from the console in web interface I was really not able to copy the text. Will find a way next time. Now I will look how to tell Z2M to use port 1883 for MQTT.

It’s in the docs

Many thanks so far - my mistake was to not enter a name in the docker-compose-file, so maybe it was generated automatically. So I renamed the mosquitto container “mqtt” (first in the GUI and then also in the docker-compose-file to make sure) and restarted zigbee2mqtt - no success.

Maybe I tried to connect to the zigbee2mqtt GUI wrong - I tried localhost:8080 which worked (as localhost:8123 of course) with the HA container. So I did not have to do any port forwarding or so to access the container. Do I have to for Zigbee2MQTT?

My feeling is that zigbee2mqtt is up and running but I cannot reach it and wonder what is my mistake.
Do I have to

localhost makes sense when not using Docker. When using Docker … not so much.

mqtt://mqtt:1883 works if your Mosquitto container’s name is mqtt… you didn’t name it anything.

1 Like

Wondering why you have 2 containers zigbee2mqtt and zigbee2mqtt-mqtt-1?

What is zigbee2mqtt-mqtt-1? If for some reason it is the mqtt container, that is odd.

PS

  1. don’t configure z2m with permit_join: true, it is insecure

  2. If you use the commandline you can copy and paste your configuration and logs.

1 Like

Many thanks for the hints. So yes in my docker-compose-file there was no container name so maybe docker(compose) just named it - so I entered it in the File and now it is names mqtt. Then I restarted everything but no success.

Do I contact it the right way by just accessing

localhost:8080

This is what worked with HA (of course port 8123) but maybe Zigbee2MQTT is up and running already and I simply don’t contact it the right way. So so I have to do some port forwarding that HA Docker does automatically? Is there another way of contacting it except “localhost”?

The reason I am asking is the error message

ERR_CONNECTION_REFUSED

that I get. No timeout or so.

Or does it require HA in any way? Because right not HA is not running (running out of memory for unclear reasons).

Only if it is running on the same machine as your browser.

What are the logs telling you?

docker logs zigbee2mqtt

1 Like

Check your username and password

To clean up thing I restarted both containers and copy the logs starting this very moment

Zigbee2MQTT:error 2023-04-15 11:00:55: Not connected to MQTT server!
Zigbee2MQTT:error 2023-04-15 11:00:55: Cannot send message: topic: 'zigbee2mqtt/bridge/state', payload: 'offline
Zigbee2MQTT:info  2023-04-15 11:00:55: Disconnecting from MQTT server
Zigbee2MQTT:info  2023-04-15 11:00:55: Stopping zigbee-herdsman...
Zigbee2MQTT:info  2023-04-15 11:00:55: Connected to MQTT server
Zigbee2MQTT:info  2023-04-15 11:00:55: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
Zigbee2MQTT:error 2023-04-15 11:00:55: MQTT error: client disconnecting
Zigbee2MQTT:info  2023-04-15 11:00:57: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
Zigbee2MQTT:info  2023-04-15 11:00:57: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"commit":"24c6b2e","coordinator":{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20221226,"transportrev":2},"type":"zStack3x0"},"log_level":"info","network":{"channel":11,"extendedPanID":"0x00124b0029de19c6","panID":6754},"permit_join":true,"version":"1.30.3"}'
Zigbee2MQTT:info  2023-04-15 11:01:04: Stopped zigbee-herdsman
Zigbee2MQTT:info  2023-04-15 11:01:04: Stopped Zigbee2MQTT
Using '/app/data' as data directory
Zigbee2MQTT:info  2023-04-15 11:01:13: Logging to console and directory: '/app/data/log/2023-04-15.11-01-12' filename: log.txt
Zigbee2MQTT:info  2023-04-15 11:01:13: Starting Zigbee2MQTT version 1.30.3 (commit #24c6b2e)
Zigbee2MQTT:info  2023-04-15 11:01:13: Starting zigbee-herdsman (0.14.103)
Zigbee2MQTT:info  2023-04-15 11:01:14: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2023-04-15 11:01:14: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20221226,"transportrev":2},"type":"zStack3x0"}'
Zigbee2MQTT:info  2023-04-15 11:01:14: Currently 2 devices are joined:
Zigbee2MQTT:info  2023-04-15 11:01:14: 0xa4c13892dc7528d5 (0xa4c13892dc7528d5): TS0601_smoke_2 - TuYa Photoelectric smoke detector (EndDevice)
Zigbee2MQTT:info  2023-04-15 11:01:14: 0x54ef441000712dae (0x54ef441000712dae): JY-GZ-01AQ - Xiaomi Aqara smart smoke detector (EndDevice)
Zigbee2MQTT:warn  2023-04-15 11:01:14: `permit_join` set to  `true` in configuration.yaml.
Zigbee2MQTT:warn  2023-04-15 11:01:14: Allowing new devices to join.
Zigbee2MQTT:warn  2023-04-15 11:01:14: Set `permit_join` to `false` once you joined all devices.
Zigbee2MQTT:info  2023-04-15 11:01:14: Zigbee: allowing new devices to join.
Zigbee2MQTT:info  2023-04-15 11:01:15: Connecting to MQTT server at mqtt://mqtt:1883
Zigbee2MQTT:info  2023-04-15 11:01:15: Connected to MQTT server
Zigbee2MQTT:info  2023-04-15 11:01:15: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
Zigbee2MQTT:info  2023-04-15 11:01:15: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"commit":"24c6b2e","coordinator":{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20221226,"transportrev":2},"type":"zStack3x0"},"log_level":"info","network":{"channel":11,"extendedPanID":"0x00124b0029de19c6","panID":6754},"permit_join":true,"version":"1.30.3"}'
Zigbee2MQTT:info  2023-04-15 11:01:15: MQTT publish: topic 'zigbee2mqtt/0x54ef441000712dae', payload '{"battery":100,"buzzer_manual_alarm":false,"buzzer_manual_mute":false,"heartbeat_indicator":false,"linkage_alarm":true,"power_outage_count":15,"smoke":false,"smoke_density":0,"smoke_density_dbm":0,"test":false,"voltage":3013}'
Zigbee2MQTT:info  2023-04-15 11:01:15: Zigbee2MQTT started!

This what I got when

  1. restarting both containers
  2. Trying to access localhost:8080 from this

Result:
ERR_CONNECTION_RESET (not refused)

Do you have

frontend:
  port: 8080

in Zigbee2mqtt’s configuration.yaml ?

1 Like

THANK YOU ALL SO MUCH!

To summarize what errors I made, what I did and how to avoid it next time:

  1. Zigbee2MQTT could not find MQTT. Why? In the docker-compose.yml I did not have
container_name: mqtt
  1. Once I accidently did try to login to localhost. This was stupid of course as this tries to login to my laptop and not my HA computer. When using http://friendlywrt:8080/ (friendlywrt is the local name on my R5S) it did login to the correct machine
  2. Zigbee2MQTT did not know which port to put the frontend on. So adding
frontend:
 port:8080

changed that.

1 Like

And as usual, it was pure misconfiguration from my side, sorry I am a docker noob but learning.

What helped me was of course the comments here but also an example from a friend who runs it successfully. This is what I combined with the examples I colied from installation guides.