Can`t start MQTT work properly

I have HA 0.103.4 with MQTT broker 5.1 add-on installed with CC2531 sniffer and spent 2 days trying to make it work.
I`ve tried many instructions and nothing helped.

I can publish and see subscribed topics in developer panel, but only if I publish it, but nothing happens when I try to add device (movement detector from Xiaomi)

It worked fine while I was using other system (not HA). Maybe there are some tricks that are not mentioned?

broker config

{
  "logins": [],
  "anonymous": false,
  "customize": {
    "active": true,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "require_certificate": false
}

broker log

[22:52:35] INFO: Setup mosquitto configuration
[22:52:35] WARNING: SSL not enabled - No valid certs found!
[22:52:35] INFO: No local user available
[22:52:35] INFO: Initialize Hass.io Add-on services
[22:52:35] INFO: Initialize Home Assistant discovery
[22:52:35] INFO: Start Mosquitto daemon
1577220755: Loading config file /share/mosquitto/acl.conf
1577220755: mosquitto version 1.6.3 starting
1577220755: Config loaded from /etc/mosquitto.conf.
1577220755: Loading plugin: /usr/share/mosquitto/auth-plug.so
1577220755: |-- *** auth-plug: startup
1577220755:  ├── Username/password checking enabled.
1577220755:  ├── TLS-PSK checking enabled.
1577220755:  └── Extended authentication not enabled.
1577220755: Opening ipv4 listen socket on port 1883.
1577220755: Opening ipv6 listen socket on port 1883.
1577220755: Opening websockets listen socket on port 1884.
1577220755: Warning: Mosquitto should not be run as root/administrator.
1577220765: New connection from 192.168.1.108 on port 1883.

You don’t have any accounts setup for MQTT - here is mine but set your own username and password


{
  "logins": [
    {
      "username": "username-here",
      "password": "Password-here"
    }
  ],
  "anonymous": true,
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "require_certificate": false,
  "permit_join": true
}

I have empty logins section, and I use the mosquitto add-on feature to generate mosquitto users from home assistant users. In homeassistant users I have one called mqtt with a long generated password, and I’ve told zigbee2mqtt to use it:

...
mqtt": {
    "base_topic": "zigbee2mqtt",
    "server": "mqtt://homeassistant",
    "user": "mqtt",
    "password": "~~~censored~~~"
  },
...

I could then pickup messages from zigbee2mqtt when looking at it in a shell, which means so can homeassistant. The final step was to tell homeassistant to connect to mqtt and turn paired devices into useful entities and states, using an mqtt integration.

Maybe zigbee2mqtt logs have something useful in your case.

ive totally forgot that I need to take zigbee protocot and transfer it to mqtt, but today Im fighting with zigbee2mqtt and mqtt broker to see each other. Z2M does see my devices, but I can`t see anything neither in HA, nor in MQTT client on my PC. And now i will unistall Z2M and mqtt and try to reconfig it from scratch

thanks, I did reset to all addons and reinstalled them and instantaneously had a notification about adding a new device. I did miss to mention protocol mqtt:// in Z2M settings.
Thanks.