Login to mosquitto-broker fails after last update

Do you have an mqtt user/passwd set in valetudo? Do you have a user in ha called valetudo, with the same password?

Thanks for your reply.
I think that URL in the valetudo config is the only place where I can set the mqtt user and password.
The same user/pwd is created in HA in the User section .
Tomorrow I will have a look if there is a newer version of valetudo, which maybe fix the problem.

FWIW uninstalling and re-installing the addon fixed the issue for me.

1 Like

Thanks for that suggestion: I found that resetting the add-on to defaults and restarting it meant I could connect with MQTT Explorer, and then I had to go to the plugin and re-enter the username and password so HA could connect to it.

This was after the update to 2022.9.2 : first time I’ve ever had an issue with MQTT.

See Login to mosquitto-broker fails after last update - #45 by nickrout

Thanks Nick, but I wasn’t using external users; just the same one defined in HA that I’d used for about three years. In the end, a combination of resetting the defaults on the add-on, reconfiguring the integration to make sure it had the right username and password, and restarting everything, worked.

I was just surprised because it had been zero-maintenance up to this point! Oh, I did also see that the add-on had an updated Mosquitto a few days ago, and did that (without problems) then. So perhaps some combination of the above circumstances confused things…

After years of no problems, I’m also suddenly having issues. All sorts of log errors about null username/password

error: received null username or password for unpwd check

Can you spell out more specifically how you fixed this @quentinsf? I’ve uninstalled/reinstalled the app. Deleted and recreated my HA user account used for MQTT. Nothing seems to be working.

I think the key thing might have been going to Settings > Add-ons > Mosquitto > Configuration and choosing ‘Reset to defaults’ at the bottom before setting things up again.

Then I went to Settings > Devices & services > Integrations > Mosquitto broker (Configure) > Re-configure MQTT to make sure the integration had the right details too.

I found MQTT Explorer (which was still set up with the old settings) a useful way to check: when it could connect again, I knew all the other devices (which had the same host/port/credentials etc) would be able to connect too.

does that help?

It looks like it defaults to the username ‘homeassistant’ with some sort of password in there. Should that ‘just work’? In my case, it does not. Should I know the password for the user ‘homeassistant’?

Not sure - I had a ‘hassio-mqtt’ user set up in HA with a password, and that’s what I set up in the integration, replacing the defaults (and it’s also what was also programmed into all my Tasmota etc devices so I didn’t want to change it!)

Okay. I reconfigured it using my dedicated MQTT HA user account. Doesn’t seem to fix my errors. What’s weird is that some things (but not all) seem to be working. I can’t yet get a handle on this issue.

If you are using the addon, you cannot use homeassistant as the username

It is very clearly documented. People complain all over the forum about the documentation, but many people also don’t seem to read the docs anyway. Hard to win.

@nickrout: Slightly bizarre that the integration defaults to that, then, since the add-on is presumably the most common way to set up MQTT by far.
Note that neither of us chose that username… it was given to us! And note that the username was not the problem in either of our cases.

People complain all over the forum about not reading the documentation, but many people don’t seem to read the whole thread anyway. Hard to win.

I’m no expert, but I don’t think we’re talking about the same thing. I believe that ‘homeassistant’ is the default (mqtt local) username when you install the addon. It is not an HA user. It only appears when you attempt to reconfigure MQTT. And since it reappeared every time I removed/reinstalled it, I feel pretty confident that its the default.

FWIW, with probably no less than 10 uninstall/reinstall/reboot/test/etc iterations, I can confirm that somehow my MQTT is finally working again. Clearly something recently changed in 2022.9, but I’ve no idea what.

If you run into this issue, just keep trying. Hopefully someone with much deeper technical knowledge will figure out what happened in the meantime.

Bravo! Persistence pays off!
Maybe that’s what happened to me too. I wonder if the ‘Reset to defaults’ actually takes some time to accomplish, or perhaps a cache has to time out somewhere in the system…
Anyway, glad you got it going!

1 Like

Yes indeed, bizarre that homeassistant is the default in the integration, when it isn’t allowed in the addon. And touchee to pointing out I didn’t properly understand that you were referring to the integration default.

I can’t even see where the defaults come from, here is the config flow code core/config_flow.py at f453726b1862d1d247f6aefdd5f23455b87c11cf · home-assistant/core · GitHub

Over my head! While I’m not terrible with python, I’ll be damned if I can ever figure out how HA code works. :rofl: I feel like I could eventually be helpful if there was someone to answer general questions to.

…and now the mosquitto addon stopped working again. Neither HASS.agent on my computer, pethublocal, or my robot vacuum can connect to it. I’m back at square one.

:frowning:

edit: Yep. Suddenly, HA users are no longer able to authenticate to MQTT. wtf

1 Like