Mosquitto Addon Setup Trouble

I am trying to setup MQTT so I can check out Zanzito. I have never used MQTT before. I have the following options in the hassio addon:

{
  "plain": true,
  "ssl": false,
  "anonymous": false,
  "logins": [
    {
      "username": "MyUserName",
      "password": "MyPassword"
    }
  ],
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Following the add-on instruction here (https://home-assistant.io/addons/mosquitto/) I added the following the my configuration.yaml file:

mqtt:
  broker: core-mosquitto

I get an error in my .log file that says:
ERROR (Thread-2) [homeassistant.components.mqtt] Unable to connect to the MQTT broker: Connection Refused: not authorised.

Any idea what is wrong or missing? Where can I find the correct documentation on how to set this up properly and test the connection in hassio? I have seen some videos on YouTube that SSH into the raspberry pi and run command line functions, but I don’t believe these are available in hassio. Is that a correct assumption?

Thanks,
Jeremy

Well, if you configure username and password in mosquitto addon, you also have to set them in HA.

mqtt:
  broker: core-mosquitto
  username: MyUserName
  password: MyPassword
  ...
2 Likes

Yep, exactly what he said :+1:

Oversight in the docs, have just tried making my first change in Github!

1 Like

Thanks for the help. I no longer get the error and I can see mqtt.publish under services. That seems like a good sign.