Home assistant docker, doent discorver the devices in the zigbee2mqtt

hey, Im new to home assistant. And I chose to use docker to host my hass. The problem im having is I can pair devices in the zigbee2mqtt but they hass doesn’t show them.

My configuration

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "homeassistant/home-assistant:latest"
    volumes:
      - /home/Dev/Docker/homeassistant:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    ports:
      - "8123:8123"
    
  #Mosquitto
  mosquitto:
    container_name: mqtt
    image: eclipse-mosquitto
    ports:
      - "1883:1883"
      - "9001:9001"
    volumes:
      - /home/Dev/Docker/mosquitto/config:/mosquitto/config
      - /home/Dev/Docker/mosquitto/data:/mosquitto/data
      - /home/Dev/Docker/mosquitto/log:/mosquitto/log
    
  zigbee2mqtt:
    container_name: zigbee2mqtt
    depends_on:
      - mosquitto
    image: koenkk/zigbee2mqtt
    volumes:
      - /home/Dev/Docker/zigbee2mqtt/data:/app/data
      - /run/udev:/run/udev:ro
    ports:
      - 8080:8080
    deploy:
      resources:
        limits:
          memory: 100M
    restart: always
    privileged: true

Logs

Zigbee2mqtt

Zigbee2MQTT:info  2022-07-09 18:21:32: MQTT publish: topic 'zigbee2mqtt/Door Sensor', payload '{"battery":100,"battery_low":false,"contact":false,"linkquality":114,"tamper":false,"voltage":3100}'

Zigbee2MQTT:info  2022-07-09 18:21:32: MQTT publish: topic 'zigbee2mqtt/Door Sensor', payload '{"battery":100,"battery_low":false,"contact":false,"linkquality":114,"tamper":false,"voltage":3100}'

Zigbee2MQTT:info  2022-07-09 18:21:49: MQTT publish: topic 'zigbee2mqtt/Door Sensor', payload '{"battery":100,"battery_low":false,"contact":true,"linkquality":117,"tamper":false,"voltage":3100}'

Zigbee2MQTT:info  2022-07-09 18:21:50: MQTT publish: topic 'zigbee2mqtt/Door Sensor', payload '{"battery":100,"battery_low":false,"contact":false,"linkquality":120,"tamper":false,"voltage":3100}'

what am I missing?

Do you have discovery turned on in both home assistant an z2m?

configuration.yml hass

mqtt:
 broker: 172.19.0.4
 port: 1883
 client_id: home-assistant
 username: mqtt-user
 password: mqtt-user
 discovery: true
 discovery_prefix: homeassistant

configuration.yml

homeassistant: true
frontend:
  port: 8080
  host: 0.0.0.0
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqttt://172.19.0.4:1883
serial:
  port: /dev/ttyUSB0
devices:
  '0x00124b0025044209':
    friendly_name: Door Sensor
advanced:
  homeassistant_discovery_topic: homeassistant

Is this just a copy/paste error? Mqtt only has two t’s

that was miss type when I was created the post. sorry

Are there correct looking topics/messages on the mqtt broker? under the homeassistant topic

You created a Home Assistant user with the username/password of mqtt-user / mqtt-user ?

yes I did

The only logs I have with topics are in the z2m

Zigbee2MQTT:info  2022-07-10 00:05:24: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Contact sensor","friendly_name":"0x00124b0025044209","model":"SNZB-04","supported":true,"vendor":"SONOFF"},"type":"pairing"}'
Zigbee2MQTT:info  2022-07-10 00:05:08: MQTT publish: topic 'zigbee2mqtt/0x00124b0025044209', payload '{"battery":null,"battery_low":false,"contact":true,"linkquality":117,"tamper":false,"voltage":null}'

You’ve also completely rebooted Home Assistant and the Z2M integration?

I already delete all the container and run the docket compose again

That is going to do no good as he is not using a supervised hass and thus doesn’t have the advantage of using home assistant logins for MQTT.

But lets assume the login for MQTT is working, as z2m appears to be able to publish to mqtt without errors appearing.

To be sure though, a check with an MQTT client like mqtt_subscribe or MQTT explorer would be useful.

@bteixeira691 The MQTT config posted in the HA yaml is not correct though. MQTT is configured in the UI not in configuration.yaml. See MQTT - Home Assistant - discovery is set up in the UI. Try that.

1 Like

thanks a lot