I need an anonymous mqtt broker, which does not in any way require username and password. I am aware of the security implications whatsoever, but i have dozens of (self-built) temperature sensors, that have no username and password configured. Updating them would force me to open up my walls and disassemble all light switches in my house, so this is not an option.
However: First I tried to use home-assistant addon mosquitto. It was not possible to disable authentication with custom mosquitto.conf (at least i found no way).
I also tried the (dirty hack) with ACL and “topic readwrite #”. This worked partially, but using some username/password for mqtt renders this useless as well.
Then i tried to build my own mosquitto-Addon for homeassistant.
I started by cloning the git-repository and modifying all possible files therein.
Copying the result into “/addons”-Folder, i was able to install my own version. Strangely, changes in config.yaml did show some effect (e.g. changing the name of the addon), but changing the files in “rootfs” did not, in any way.
What i tried was:
changing mosquitto.gtpl by commenting out all lines with “auth” in it
changing “Dockerfile” to not build mosquitto-auth-plugin.so
changing rootfs/etc/services.d/run so that only /share/mosquitto/mosquitto.conf is loaded
changing rootfs/etc/cont-init.d/mosquitto.sh so that no mosquitto.conf is generated by bashio, but my own is used
** This file is apparently not invoked in any way, because additional log output was not shown in the log
adding rootfs/etc/mosquitto/mosquitto.conf to be used by this container
I found out that changing the version-number in config.yaml has an effect on the docker-image which is pulled and executed, which was against my expectations, but anyway.
I am totally out of ideas.
Has anybody had this specific problem? How did you solve it?
Isn’t installing mosquitto (or any other MQTT broker) on another device not an option?
If tou are really not concerned about security issues, there are cloud-based MQTT as well.
Thanks for the link, it is a short summary of all the information pieces that i found in different places.
allow_anonymous true
was one of the first things i tried. This did not work.
The biggest problem i have is that there are no error messages whatsoever.
Using mosquitto_sub -h <ha-ip> - t "#" -v -d on one console and mosquitto_pub -h <ha-ip> -t "/test" -m 123 on the other just does not produce any output on the first one. It should on a correctly configured broker.
@koying I prefer having the broker inside my own network (reliability, privacy).
Using another device for running the broker is the last option, and i don’t really want to take this one.
I refuse to accept that it is impossible to run an anonymous broker on a home assistant os device.
meanwhile i am beyond the point where i just want to have an anonymos mqtt broker - i really want to understand why none of the changes i did to the mqtt-addon have had any effect.
I also tested to modify the /etc/mosquitto/mosquitto.conf file in the running docker image (of the official mosquitto addon). But after that the addon just won’t start and fail with an error “the docker image addon_local_mqtt” already exists" or something like that (cant recall it exactly atm).
The more i see i wonder why docker is so d*** complicated…