Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103378

Cannot connect Zigbee2mqtt to MQTT : docker install

$
0
0

Hello everybody,

I am new to Home Assistant and I am tryng to set up a basic Home Assistant configuration with some Zigbee devices I already have. I am using Docker installation on a Ubuntu laptop (and I am new to Docker too).
I tested the ZHA integration (very easy to set up) but while I could easily connect to some LIDL and Sonoff devices, I could not finalise the configuration of some others (IKEA and Lexman).

So I moved to mqtt and zigbee2mqtt. I have got no error while configuring my containers. However, it looks like zigbee2mqtt cannot connect to mqtt broker; the last message the corresponding container log is:

Zigbee2MQTT:info  2022-05-09 21:19:47: Connecting to MQTT server at mqtt://192.168.xx.xxx

No other message follow and when I stop the container I get:

Zigbee2MQTT:error 2022-05-09 21:19:32: Failed to call 'Frontend' 'stop' (TypeError: Cannot read properties of null (reading 'clients')
    at Controller.callExtensions (/app/lib/controller.ts:316:40)
    at Frontend.stop (/app/lib/extension/frontend.ts:59:39)
    at stop (/app/index.js:114:5)
    at process.handleQuit (/app/index.js:120:9))
Zigbee2MQTT:error 2022-05-09 21:19:32: Not connected to MQTT server!
    at Controller.stop (/app/lib/controller.ts:191:9)

I cannot figure out what’s going wrong. I have no log from mosquitto (even by adding log_type all in its config file) to check from that side…however it looks like mqtt is running and correctly set up in Home Assistant (no error in that phase…but I do not know if there is any way to check that mqtt respond correctly to any request).

I add that the frontend of zigbee2mqtt is not available (which seems to confirm that zigbee2mqtt is not really ON even if I get no error message).
For information, I also add some errors previously with zigbee2mqtt (which crashed that time) because the USB zigbee dongle was still associated which ZHA. Since then, I removed the ZHA integration and that error went away…leading me to my actual issue: no error message, but zigbee2mqtt not really fonctional.

Thanks in advance for your help.

Here follows my docker-compose file:

version: '3.0'

services:

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

  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /mnt/soft_space/dockData/homeassistant/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto
    volumes:
      - /mnt/soft_space/dockData/mosquitto:/mosquitto
    ports:
      - 1883:1883
      - 9001:9001

  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt
    restart: unless-stopped
    volumes:
      - /mnt/soft_space/dockData/zigbee2mqtt/data:/app/data
      - /run/udev:/run/udev:ro
    ports:
      - 8080:8080
    environment:
      - TZ=Europe/Paris
    devices:
      - /dev/ttyUSB0:/dev/ttyACM0

…and the config files of mosquitto :

persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
log_type all
listener 1883

## Authentication ##
allow_anonymous false
password_file /mosquitto/config/password.txt

…and of zigbee2mqtt:

# Home Assistant integration (MQTT discovery)
homeassistant: true

# allow new devices to join
permit_join: true

frontend: true

# MQTT settings
mqtt:
  # MQTT base topic for zigbee2mqtt MQTT messages
  base_topic: zigbee2mqtt
  # MQTT server URL
  server: 'mqtt://192.168.xx.xxx'
  # MQTT server authentication, uncomment if required:
  user: hass
  password: xxxxxxxxxxxxx

# Serial settings
serial:
  # Location of CC2531 USB sniffer
  port: /dev/ttyACM0

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 103378

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>