MQTT devices don't show up in HA, unsure about Zigbee2MQTT config

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?

Did you add the mqtt integration ?

afbeelding

Yes I did, using the Docker IP address and the created user/password. It says it connects, but maybe I blocked Zigbee2MQTT from accessing it.
The “Download diagnostics” snippet is from the integrated MQTT.

Could it have to do with HA starting first?

Does it make sense to set dependencies in the Docker-Compose-File to make sure that MQTT is running first?

It seems like the username was the problem. No idea what I did wrong but after setting it to permit join = true it works and all items show up!