@lg.lindstrom (Lars-Göran Lindström) posted a new topic, subject "Where to configure Mosquitto". It read:

   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:
    [code] 
        logins: []
        customize:
          active: false
          folder: mosquitto
        certfile: fullchain.pem
        keyfile: privkey.pem
        require_certificate: false
        
    [/code]
    
    I cant find any other means to configer the Mosquitto Broker.
    
    Can anyone help me with the obviuos…

@tom_l replied

    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.

So @lg.lindstrom (Lars-Göran Lindström) replied

    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 ???

To which @tom_l replied

    It is in the Addon documentation.
    
    Screenshot 2021-09-10 at 19-12-56 Supervisor - Home Assistant922×1017 56.1 KB
    
    lg.lindstrom:
    
    > do this mean that no devices can access the broker anonymous ???
    
    Yes.

After which, @tom_l added

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

After which, @lg.lindstrom (Lars-Göran Lindström) added

    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 ??


{'source': 'discourse', 'url': 'https://community.home-assistant.io/t/where-to-configure-mosquitto/337346', 'title': 'Where to configure Mosquitto', 'views': 1669, 'has_accepted_answer': False, 'word_count': 384, 'like_count': 0, 'reply_count': 2, 'participant_count': 2, 'posts': 6, 'tags': 'mosquitto', 'author': '@lg.lindstrom (Lars-Göran Lindström)', 'participants': '@lg.lindstrom (Lars-Göran Lindström), @tom_l', 'image_url': [None], 'created_at': '2021-09-10T08:18:54.120Z', 'last_posted_at': '2021-09-10T09:24:01.369Z'}