Hi.
I’ve been using Home Assistant for a while in a Docker container, and I also had a mosquito broker set up in another container. I managed to set up the MQTT integration and everything worked just fine.
Recently, however, I decided to try out a supervised installation of Home Assistant. I used the Add-on store to install the mosquito broker, however, it seems like clients cannot subscribe to topics anymore.
Here’s what I get when I test the MQTT broker using the following command: mosquitto_sub -h 192.168.0.12 -t 'some/topic' -d
Client (null) sending CONNECT
Client (null) received CONNACK (0)
Client (null) sending SUBSCRIBE (Mid: 1, Topic: some/topic, QoS: 0, Options: 0x00)
Client (null) received SUBACK
Subscribed (mid: 1): 128
Client (null) sending DISCONNECT
All subscription requests were denied.
I did a bit of googling and found out that I had to log in using a username and password (just added -u my_username -P my_password to the command above). And just like that, I was able to connect to the broker and subscribe to topics.
The thing is, that I would like to be able to use the MQTT broker without logging in with an account. My configuration is this:
I read on some forum that there’s an anonymous option, however, it does not seem to do anything.
I do understand that it’s safer to have some kind of authentication, but still, I would like to disable it.
Is there any way to do it?
But adding allow_anonymous true to either of these does not change anything. I tried restarting the mosquito addon as well as restarting Home Assistant completely.
This doesn’t work either.
I should also add that I just noticed something. Last night I left the file content like I shown in my previous comment. This morning I read your comment and when I opened the mosquitto config, I noticed that the file was “reset”. allow_anonymous was set to false, and I definitely left that on true last night.
Edit: Warning! This may cause the MQTT integration to stop receiving MQTT messages. In case if you experience such behavior, go to Configuration > Integrations > (MQTT Broker)Configure > Reconfigure MQTT. Here, if you have a username/password set, delete them (make sure to back it up into a text file or something just to be on the safe side. Save the configuration and the issue should be fixed.