Devices in Zigbee2MQTT but none in HA? (Docker)

Hi everyone.

After having tried a HA lite setup running on a VM on my Windows PC with a Sonoff zigbee dongle 3.0 i decided to jump into this world, bought and set it up on a RPI5. I know Docker quite well from work, and have both Zigbee2MQTT, Mosquitto, Node-Red, Portainer and Homeassistant all running in Docker-containers on my Pi, that i can successfully access. I have communication between Mosquitto and Zigbee2MQTT, as i can open the Zigbee2MQTT frontend, and see that i can successfully find my smart-devices, and add them.

However, for some annoying reason they don’t appear in my Home-assistant. I know it is not hardware-related, as i can see in MQTT-explorer that the devices are updating when i press their buttons etc. The dongle was also working fine before i moved to docker. I have searched around for 3 hours but found no solution. When i go to Configurations->Add device to setup my zigbee dongle i see my correct /dev/ttyACM0 port, and i try to add it, but it just keeps throwing me an “unknown error”.

What am i missing here? Before Docker my devices would automatically show up on my dashboard once found by Zigbee2MQTT, but i guess since they are seperate Docker instances in this case, i somehow need the HA container to discover them aswell, right?

This is my configurations.yaml file for Zigbee2Mqtt

With what i can see in MQTT explorer:

image

Realised you might also want my docker compose file, that i use to run it all:

version: "3"
services:

  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /opt/homeassistant:/config
      - /etc/localtime:/etc/localtime:dk
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    devices: 
      - /dev/ttyACM0:/dev/ttyACM0
    privileged: true
    network_mode: host

  portainer:
    container_name: portainer
    image: portainer/portainer-ce
    restart: always
    ports:
      - "9000:9000/tcp"
    environment:
      - TZ=Europe/London
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/portainer:/data

  node-red:
    image: nodered/node-red:latest
    container_name: node-red
    environment:
      - TZ=Europe/London
    ports:
      - "1880:1880"
    volumes:
      - /opt/nodered/data:/data

  mosquitto:
    image: eclipse-mosquitto
    hostname: mosquitto
    container_name: mosquitto
    restart: unless-stopped
    ports:
      - "1883:1883"
      - "9001:9001"
    volumes:
      - /opt/mosquitto:/etc/mosquitto
      - /opt/mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf
      - /opt/mosquitto/config/pwfile:/mosquitto/config/pwfile

  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt
    restart: unless-stopped
    volumes:
      - /opt/zigbee2mqtt/data:/app/data
      - /run/udev:/run/udev:ro
    ports:
      # Frontend port
      - 8080:8080
    environment:
      - TZ=Europe/Berlin
    devices:
      # Make sure this matched your adapter location
      - /dev/ttyACM0:/dev/ttyACM0

This is my zigbbe2mqtt setup for docker compose

  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt:latest
    restart: unless-stopped
    volumes:
      - ./zigbee2mqtt/data:/app/data
      - /run/udev:/run/udev:ro
    ports:
      - 8090:8080
    environment:
      - TZ=Europe/Zagreb
    devices:
      # Make sure this matched your adapter location
      - /dev/serial/by-id/usb-Silicon_Labs_slae.sh_cc2652rb_stick_-_slaesh_s_iot_stuff_00_12_4B_00_23_90_C7_F4-if00-port0:/dev/ttyACM0
      # user and group settings
    group_add:
      - dialout
    user: 1001:1001
    depends_on:
      - mosquitto

You probably did enabled discovery in mqtt integration…?

It was not mentioned in any of the guides that I used i think, but i went to settings → devices and services → searched for MQTT → Inserted my broker IP etc. and then they would show up under MQTT. I guess i can add them manually somehow, now that they are finally appearing. Now i just have this thing though.

image

I guess now my HA container is discovering my devices over MQTT, instead of using the dongle to see them over Zigbee, right?

I believe so. You can set this to ignore if you gonna use zigbee2mqtt as this is for zha integration.
If you enabled auto discovery in mqtt integration they will just appear as you add them in z2m.