My setup is a Docker-based Zigbee2MQTT and HA system, I have the Sonoff USB-P dongle with three devices connected to it.
Docker-Compose
version: '3.8'
services:
mqtt:
container_name: mqtt
image: eclipse-mosquitto:2.0
restart: unless-stopped
volumes:
- "./mosquitto-data:/mosquitto"
ports:
- "1883:1883"
- "9001:9001"
command: "mosquitto -c /mosquitto-no-auth.conf"
zigbee2mqtt:
container_name: zigbee2mqtt
restart: unless-stopped
image: koenkk/zigbee2mqtt
volumes:
- ./zigbee2mqtt-data:/app/data
- /run/udev:/run/udev:ro
ports:
- 8080:8080
environment:
- TZ=Europe/Berlin
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
Zigbee2MQTT configuration.yaml
homeassistant: true
permit_join: false
user mqtt
password_file /mosquitto/credentials
mqtt:
base_topic: zigbee2mqtt
server: mqtt://mqtt:1883
serial:
port: /dev/ttyUSB0
frontend:
port: 8080
Zigbee2MQTT is running, I can see all devices, wonderful.
The only problem: They did not show up in HA.
So I did what was recommended in all tutorials, created the user mqtt, created the credentials file. Then I checked the Docker IP
Download diagnostics is giving me
{
"home_assistant": {
"installation_type": "Home Assistant Container",
"version": "2023.4.6",
"dev": false,
"hassio": false,
"virtualenv": false,
"python_version": "3.10.10",
"docker": true,
"arch": "aarch64",
"timezone": "Europe/Berlin",
"os_name": "Linux",
"os_version": "5.10.110",
"run_as_root": true
},
"custom_components": {},
"integration_manifest": {
"domain": "mqtt",
"name": "MQTT",
"codeowners": [
"@emontnemery",
"@jbouwh"
],
"config_flow": true,
"dependencies": [
"file_upload",
"http"
],
"documentation": "https://www.home-assistant.io/integrations/mqtt",
"iot_class": "local_push",
"quality_scale": "gold",
"requirements": [
"paho-mqtt==1.6.1"
],
"is_built_in": true
},
"data": {
"connected": true,
"mqtt_config": {
"birth_message": {
"topic": "homeassistant/status",
"payload": "online",
"qos": 0,
"retain": false
},
"discovery": true,
"discovery_prefix": "homeassistant",
"port": 1883,
"protocol": "3.1.1",
"transport": "tcp",
"will_message": {
"topic": "homeassistant/status",
"payload": "offline",
"qos": 0,
"retain": false
},
"keepalive": 60,
"broker": "172.18.0.2",
"username": "**REDACTED**",
"password": "**REDACTED**"
},
"devices": [],
"mqtt_debug_info": {
"entities": [],
"triggers": []
}
}
}
So what did I do wrong, was it a bad idea to create the user / credentials for MQTT? Did I search wrong for the devices? Do I have to point to user/password in the docker-compose instead of
mosquitto-no-auth.conf
? How?