Hi, I’m trying to setup MQTT on my Hassio setup on raspberry pi.
I keep getting these errors in my MQTT broker addon log:
[INFO] Setup mosquitto configuration
[INFO] Found local users inside config
[INFO] Initialize Hass.io Add-on services
[INFO] Initialize Home Assistant discovery
[INFO] Start Mosquitto daemon
1542745522: mosquitto version 1.4.15 (build date 2018-03-04 15:35:59+0000) starting
1542745522: Config loaded from /etc/mosquitto.conf.
1542745522: *** auth-plug: startup
1542745522: ** Configured order: http
1542745522: Opening ipv4 listen socket on port 1883.
1542745522: Opening ipv6 listen socket on port 1883.
1542745522: Opening websockets listen socket on port 1884.
1542745522: Opening ipv4 listen socket on port 8883.
1542745522: Opening ipv6 listen socket on port 8883.
1542745522: Opening websockets listen socket on port 8884.
1542745522: Warning: Mosquitto should not be run as root/administrator.
1542745522: New connection from 192.168.1.50 on port 1883.
[WARN] Not found "unique_login_name" on local database
1542745650: Socket error on client <unknown>, disconnecting.
Where unique_login_name is my user login as configured in addon config:
{
"logins": [
{
"username": unique_login_name,
"password": "!secret mqtt_password"
}
],
"anonymous": false,
"customize": {
"active": false,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
}
similarily in my configuration.yaml I have MQTT section as follows:
mqtt:
broker: core-mosquitto
username: unique_login_name
password: !secret mqtt_password
On my Tasmota config, I can see the temp and humidity with no problems but I just cannot connect to the broker on HA because the user is not found on the local database. Here is my tasmota mqtt config:
And below is my sensor config:
sensor 3:
- platform: mqtt
state_topic: 'tele/SensorOne/Sensor'
name: 'Temperature'
unit_of_measurment: '°C'
value_template: '{{ value_json.SI7021.Temperature }}'
- platform: mqtt
state_topic: 'tele/SensorOne/Sensor'
name: 'Humidity'
unit_of_measurment: '%'
value_template: '{{ value_json.SI7021.Humidity }}'
Any help would be greatly appreciated, thank you.