Installed the new MQTT 4.1 Addon for Hass.io
I have a Home Assistant User called mqttuser created. This is used in all my devices for MQTT authentication with the broker.
Because of this, I have ALL MQTT broker settings as default. (No local user or password) All ports are as per default.
Broker Config:
{
"logins": [],
"anonymous": false,
"customize": {
"active": false,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
}
This works perfectly.
IF I enable the ACL by setting
"active":true,
Nothing works. I get connection errors in the Tasmota Console as well.
I have created a mosquitto folder:
accesscontrollist file has:
topic readwrite #
acl.conf has:
acl_file /share/mosquitto/accesscontrollist
I get console full of:
[INFO] Setup mosquitto configuration
[WARN] SSL not enabled - No valid certs found!
[INFO] No local user available
[INFO] Initialize Hass.io Add-on services
[INFO] Initialize Home Assistant discovery
[INFO] Start Mosquitto daemon
1552446167: mosquitto version 1.5.6 starting
1552446167: Config loaded from /etc/mosquitto.conf.
1552446167: |-- *** auth-plug: startup
1552446167: |-- ** Configured order: http
1552446167: |-- with_tls=false
1552446167: |-- getuser_uri=/login
1552446167: |-- superuser_uri=/superuser
1552446167: |-- aclcheck_uri=/acl
1552446167: |-- getuser_params=(null)
1552446167: |-- superuser_params=(null)
1552446167: |-- aclcheck_params=(null)
1552446167: |-- retry_count=3
1552446167: Opening ipv4 listen socket on port 1883.
1552446167: Opening ipv6 listen socket on port 1883.
1552446167: Opening websockets listen socket on port 1884.
1552446167: Warning: Mosquitto should not be run as root/administrator.
1552446169: New connection from 172.30.32.1 on port 1883.
1552446170: Socket error on client <unknown>, disconnecting.
1552446170: New connection from 172.30.32.1 on port 1883.
1552446170: |-- mosquitto_auth_unpwd_check(homeassistant)
1552446170: |-- ** checking backend http
1552446170: |-- url=http://127.0.0.1:8080/login
1552446170: |-- data=username=homeassistant&password=***redacted***&topic=&acc=-1&clientid=
[INFO] found homeassistant on local database
1552446170: |-- getuser(homeassistant) AUTHENTICATED=1 by http
1552446170: Socket error on client <unknown>, disconnecting.
1552446170: New connection from 172.30.32.1 on port 1883.
1552446172: Socket error on client <unknown>, disconnecting.
1552446172: New connection from 172.30.32.1 on port 1883.
1552446172: |-- mosquitto_auth_unpwd_check(homeassistant)
1552446172: |-- ** checking backend http
1552446172: |-- url=http://127.0.0.1:8080/login
1552446172: |-- data=username=homeassistant&password=***redacted***&topic=&acc=-1&clientid=
[INFO] found homeassistant on local database
1552446172: |-- getuser(homeassistant) AUTHENTICATED=1 by http
1552446172: Socket error on client <unknown>, disconnecting.
1552446172: New connection from 172.30.32.1 on port 1883.
and in Tasmota Console:
14:02:44 MQT: Attempting connection...
14:02:44 MQT: Connect failed to 10.90.11.100:1883, rc -2. Retry in 10 sec
14:02:55 MQT: Attempting connection...
14:03:10 MQT: Connect failed to 10.90.11.100:1883, rc -4. Retry in 10 sec
14:03:21 MQT: Attempting connection...
14:03:36 MQT: Connect failed to 10.90.11.100:1883, rc -4. Retry in 10 sec
14:03:47 MQT: Attempting connection...
14:04:02 MQT: Connect failed to 10.90.11.100:1883, rc -4. Retry in 10 sec
14:04:13 MQT: Attempting connection...
14:04:28 MQT: Connect failed to 10.90.11.100:1883, rc -4. Retry in 10 sec
If I set active:false and restart the broker all is good again (as in it works):
1552446376: New connection from 10.90.11.50 on port 1883.
1552446376: |-- mosquitto_auth_unpwd_check(mqttuser)
1552446376: |-- ** checking backend http
1552446376: |-- url=http://127.0.0.1:8080/login
1552446376: |-- data=username=mqttuser&password=***redacted***&topic=&acc=-1&clientid=
[INFO] found mqttuser on Home Assistant
1552446376: New client connected from 10.90.11.50 as DVES_4E6C26 (c1, k10, u'mqttuser').
1552446376: |-- getuser(mqttuser) AUTHENTICATED=1 by http
1552446376: New connection from 10.90.11.55 on port 1883.
1552446376: New connection from 10.90.11.35 on port 1883.
1552446376: New connection from 10.90.11.22 on port 1883.
1552446376: |-- mosquitto_auth_unpwd_check(mqttuser)
1552446376: |-- ** checking backend http
1552446376: |-- url=http://127.0.0.1:8080/login
1552446376: |-- data=username=mqttuser&password=***redacted***&topic=&acc=-1&clientid=
[INFO] found mqttuser on Home Assistant
1552446377: |-- getuser(mqttuser) AUTHENTICATED=1 by http
1552446377: New client connected from 10.90.11.55 as DVES_684D92 (c1, k10, u'mqttuser').
1552446377: |-- mosquitto_auth_unpwd_check(mqttuser)
1552446377: |-- ** checking backend http
1552446377: |-- url=http://127.0.0.1:8080/login
1552446377: |-- data=username=mqttuser&password=***redacted***&topic=&acc=-1&clientid=
[INFO] found mqttuser on Home Assistant
1552446377: |-- getuser(mqttuser) AUTHENTICATED=1 by http
1552446377: New client connected from 10.90.11.35 as DVES_A84353 (c1, k10, u'mqttuser').
1552446377: |-- mosquitto_auth_unpwd_check(mqttuser)
1552446377: |-- ** checking backend http
1552446377: |-- url=http://127.0.0.1:8080/login
1552446377: |-- data=username=mqttuser&password=***redacted***&topic=&acc=-1&clientid=
and Tasmota Console:
14:06:16 MQT: Attempting connection...
14:06:19 MQT: Connected
14:06:19 MQT: sonoff1/tele/LWT = Online (retained)
14:06:19 MQT: sonoff1/cmnd/POWER =
I am at a loss to see what I am screwing up hereâŚ