I am using the addon in Hassio for MQTT .
# Home Assistant Add-on: Mosquitto broker
MQTT broker for Home Assistant.
![Supports aarch64 Architecture][aarch64-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield] ![Supports i386 Architecture][i386-shield]
## About
You can use this add-on to install Eclipse Mosquitto, which is an open-source (EPL/EDL licensed) message broker that implements the MQTT protocol. Mosquitto is lightweight and is suitable for use on all devices from low power single board computers to full servers. For more information, please see [mosquitto].
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg
In the documentation the warning states to disable anonymous: and set logins:
When not doing so, I get a warning in the MQTT-log saying:
When following the documentation recommendation, I am getting this error messages:
Could someone please tell me how to set up MQTT to maintain security.
MQTT or Mosquitto?
Mosquitto can use client certs but I’m not certain they’re implemented in HA. You can for stuff like Owntracks over MQTT. In all honesty if they’re on the LAN you don’t really need that level of security (if someone is on your network snooping your traffic you have a bigger issue). You should be using at a minimum a user/pass combo that you set up when configuring Mosquitto.
What’s in your configuration.yaml?
Mine looks like this:
# MQTT
mqtt:
broker: core-mosquitto
username: !secret mqtt_user_name
password: !secret mqtt_password
where username and password are as configured in the broker addon
{
"plain": true,
"ssl": false,
"anonymous": false,
"logins": [
{
"username": "xxxxxx",
"password": "xxxxxx"
}
],
"customize": {
"active": false,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
}
1 Like
It was a user- keyboard interface error.
Meaning my bad, since I obviously can’t write the simplest things.
1 Like