Mosquitto MQTT 4.1 doesnt work after update

I still get all this warning logs but MQTT messages works so I don’t touch it!

Good morning, even since I updated my MQTT to 4.1 I have problems I followed a bit of discussion but I can’t get out of it, I want to see my configuration:

this is my “LOG” which seems to be all right the devices log in and are detected:

[INFO] Setup mosquitto configuration [WARN] SSL not enabled - No valid certs found! [INFO] Found local users inside config [INFO] Initialize Hass.io Add-on services [INFO] Initialize Home Assistant discovery [INFO] Start Mosquitto daemon 1552727870: mosquitto version 1.5.6 starting 1552727870: Config loaded from /etc/mosquitto.conf. 1552727870: |-- *** auth-plug: startup 1552727870: |-- ** Configured order: http 1552727870: |-- with_tls=false 1552727870: |-- getuser_uri=/login 1552727870: |-- superuser_uri=/superuser 1552727870: |-- aclcheck_uri=/acl 1552727870: Opening ipv4 listen socket on port 1883. 1552727870: |-- getuser_params=(null) 1552727870: |-- superuser_params=(null) 1552727870: |-- aclcheck_params=(null) 1552727870: |-- retry_count=3 1552727870: Opening ipv6 listen socket on port 1883. 1552727870: Opening websockets listen socket on port 1884. 1552727870: Warning: Mosquitto should not be run as root/administrator. 1552727873: New connection from 192.168.1.66 on port 1883. 1552727873: |-- mosquitto_auth_unpwd_check(admin) 1552727873: |-- ** checking backend http 1552727873: |-- url=http://127.0.0.1:8080/login 1552727873: |-- data=username=admin&password=admin&topic=&acc=-1&clientid= [INFO] found admin on local database 1552727875: |-- getuser(admin) AUTHENTICATED=1 by http 1552727875: New client connected from 192.168.1.66 as GarHAge (c1, k15, u'admin'). 1552727875: New connection from 192.168.1.119 on port 1883. 1552727875: New connection from 192.168.1.218 on port 1883. 1552727875: |-- mosquitto_auth_unpwd_check(admin) 1552727875: |-- ** checking backend http 1552727875: |-- url=http://127.0.0.1:8080/login 1552727875: |-- data=username=admin&password=admin&topic=&acc=-1&clientid= [INFO] found admin on local database 1552727877: |-- getuser(admin) AUTHENTICATED=1 by http 1552727877: New client connected from 192.168.1.119 as ESPClient_BC:DD:C2:08:CB:E8 (c1, k10, u'admin'). 1552727877: |-- mosquitto_auth_unpwd_check(admin) 1552727877: |-- ** checking backend http 1552727877: |-- url=http://127.0.0.1:8080/login 1552727877: |-- data=username=admin&password=admin&topic=&acc=-1&clientid= [INFO] found admin on local database 1552727880: |-- getuser(admin) AUTHENTICATED=1 by http 1552727880: New client connected from 192.168.1.218 as esp8266-5c:cf:7f:23:d0:a7 (c1, k15, u'admin'). 1552727880: New connection from 192.168.1.157 on port 1883. 1552727880: |-- mosquitto_auth_unpwd_check(admin) 1552727880: |-- ** checking backend http 1552727880: |-- url=http://127.0.0.1:8080/login 1552727880: |-- data=username=admin&password=admin&topic=&acc=-1&clientid= [INFO] found admin on local database 1552727882: New client connected from 192.168.1.157 as DVES_9F4CB7 (c1, k15, u'admin'). 1552727882: |-- getuser(admin) AUTHENTICATED=1 by http 1552727882: New connection from 192.168.1.199 on port 1883. 1552727882: |-- mosquitto_auth_unpwd_check(admin) 1552727882: |-- ** checking backend http 1552727882: |-- url=http://127.0.0.1:8080/login 1552727882: |-- data=username=admin&password=admin&topic=&acc=-1&clientid= [INFO] found admin on local database 1552727885: New client connected from 192.168.1.199 as DVES_08C7BC (c1, k15, u'admin'). 1552727885: |-- getuser(admin) AUTHENTICATED=1 by http

I created the files “controllaccesslist” and “acl.conf” and this seems to have been done well since the LOG is positive

this is my configuration in Configuration.yaml

mqtt:
  broker: 192.168.1.101 
  port: 1883
  Username: admin
  Password: admin

which gives me the following error:

Invalid config for [mqtt]: [Username] is an invalid option for [mqtt]. Check: mqtt->mqtt->Username. (See /config/configuration.yaml, line 174). Please check the docs at https://home-assistant.io/components/mqtt/

where am I wrong? I seem to be close but the solution does not arrive

This worked for me. Thank you

If you use active true you have to configure an ACL… Set active false and it should work

Resolved!! I set the default configuration from the Add-on Mosquito, from Configuration.yaml I deleted the two entries “Username” and “password” I created a user with the name “mqtt” and I set the same name and password as my peripherals in my case were “admin” and “admin” all OK

None of this is working for me.

I have no ACL, and anonymous is set to true, but none of my topics were being published to on version 4.1. The logs looked like the clients were connecting but nothing being published. Here’s my config

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

I ended up downgrading the Mosquitto add-on to version 4 from a hass.io snapshot and I’m back up and running.

Your client used name and password?

it’s anonymous (in that my client doesn’t need to specify one to post with addon v4)

So to get this right - I need to add a user to HA and use that for my MQTT devices otherwise it won’t work?

1 Like

You can either use a Home Assistant user or configure a local user in the addon and then that user should be configured in the devices MQTT settings.

I’ve never used anonymous but if the device supports that it should work I guess.

I got everything to work following this except for my automations involving mqtt.publish. I had to create all new automations from within Configuration - Automation to get it to work.
Everything else worked fine. Node Red etc.

Doesn’t make sense… did the topics change? Did you switch to discovery?

Topics stayed the same. My mqtt broker was configured in configuration.yaml, but at one point during my troubleshooting I switched to setting it up in integrations and while I was doing that I probably checked discovery.
I however reverted back to configuration.yaml and haven’t enabled discovery.
There are still some of my automations I can’t get to work even after recreating them in Configuration - Automation

Have you checked the topic in the Tasmota console agrees with the automation? Have you made sure the user/password and IP address of broker is correct? It makes no sense this would have stopped working.

I have checked everything. The Automation doesn’t work, but I can send to the same topic in NodeRed and it works fine

initial state = on ?

Thanks Klagio,
Never used that and never got in trouble. All off a sudden all of the automations decided to turn off and thats what got me in trouble.

I suggested to the dev to make by default initial_state=on (if I code an automation its because I want it to be triggered, when its triggered), but they prefer this way.

I solved by putting in all my automation initial_state=on

I noticed that all my automations got ids after I created the first automation via the Configuration - Automations page. What else is technically supposed to have ids? I am getting a lot of these MQTT logs. Are they related to missing ids?
1552924048: |-- mosquitto_auth_acl_check(..., client id not available, pool, pool/heater/volt, MOSQ_ACL_READ)
1552924048: |-- aclcheck(pool, pool/heater/volt, 1) CACHEDAUTH: 0
1552924048: |-- mosquitto_auth_acl_check(..., client id not available, pool, pool/pressure/volt, MOSQ_ACL_WRITE)

Also, when you do make an automation via Configuration - Automation Editor, that selection is not even an option, but I guess it happens by default when you create a new automation in there.
I ended up reverting to just doing the automations in YAML since I didn’t like the interface and there seems to be a lot you can’t do in there.