Where to configure Mosquitto

I have a RPI 4 running Home Assistant Supervised. Using the supervisor I added the Mosquitto broker add-on.

The overall plan, is to design some devices of my own and connect them to HA.

In the purpose to understand more I downloaded a Mqtt client app to my tablet.

Using this app I can connect to the Mosquitto broker but I can’t either subscribe neither publish to any topic on the Mosquitto broker. The response from the Mosquitto broker is always “refused”

The configuration file in the supervisor panel looks like this:

logins: []
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

I cant find any other means to configer the Mosquitto Broker.

Can anyone help me with the obviuos… :slight_smile:

Did you create a user in the home assistant mqtt integration?

I think local anonymous logins were disabled in version 5 of the addon.

So either create a user when adding the Home Assistant MQTT integration (noting the one username you cant use as specified in the Mosquitto addon docs) or add a local user in the addon config you’ve shown above.

I can’t find the syntax for setting up a user in the file above ??? Can you point me to the description of the syntax???

Another question, do this mean that no devices can access the broker anonymous ???

It is in the Addon documentation.

Yes.

I suggest you read the top of that page about creating a user with home assistant instead though.

Okay, I found another way to do it. I just added a user to HA, and then used that user in the tablet app when I connect to the broker.

Regarding requirement to login to the broker.
I was planning to use WPS to connect my small devices to the wifi netwwork and then just let them search for the home assistant using mDns.
Now I must provide them with a hardcoded user/password or create some kind of configuration process.

Do you have any ideas how to handle this in the simplest and most robust way ??