logo elektroda
logo elektroda
X
logo elektroda

How to recover MQTT password from Mosquitto broker in new Home Assistant?

p.kaczmarek2  Cool? (+4)
📢 Listen (AI):
MQTT broker options window with the password field showing __**password_not_changed**__.
How to recover lost/forgotten MQTT password without creating new MQTT user, without having to reinstall everything again? Why does my password field reads "__**password_not_changed**__" ? Home Assistant Mosquitto broker behaviour has been recently changed. In the past the password was easily accessible via Home Assistant Devices & Services -> MQTT menu, but now it's hidden. That could have taken some users by suprise (including me), so here's a simple solution.

So, in the past, Home Assistant MQTT password used to be easily available in Re-Configure MQTT menu:
Screenshot of MQTT settings in Home Assistant with the Re-Configure MQTT button highlighted.
It was easy to display it and copy to your devices to configure them. However, with recent update 2024.5, it is not possible to get password there:
MQTT broker settings message in Home Assistant with password __**password_not_changed**__.
Luckily you can still get it from core.config_entries. For that, you will need to access this file. I have SMB integration already installed, which makes HA access from Windows easy:
Screenshot of a Windows window showing a network directory view.
Of course, any other file access solution should also work, it does not have to be the one I used.
Connect to it and navigate to path:

/config/.storage/core.config_entries

Note that .storage directory will be hidden:
Screenshot of a file manager showing the .storage folder in the config directory.
Now, open this file with any text editor and search for Mosquitto:
Screenshot of a text editor with an open file showing Mosquitto configuration in Home Assistant.
and here it is - this your lost MQTT password!
Of course, do not edit this file, just copy out your password...

Now you can easily use it to configure your other devices, for example, OpenBeken.

Screenshot of the MQTT settings interface with filled fields for host, port, client topic, and user.

That's how you can recover your MQTT Mosquitto password now! I hope you've found it helpful. I must admit, that change has taken me a bit by suprise, I didn't expect HA team to hide this password suddenly, as it was visible in the Re-configure menu for years.... strange, but least we know how to recover it.

About Author
p.kaczmarek2
p.kaczmarek2 wrote 12312 posts with rating 10198 , helped 582 times. Been with us since 2014 year.

Comments

krzbor 05 Jan 2025 17:48

Personally, I prefer not to integrate everything in HA. Ideally, Mosquitto should be on a separate machine. Since the MQTT broker is the 'heart' of the entire smart home infrastructure its independence... [Read more]

@GUTEK@ 06 Jan 2025 17:19

I upgraded Debian 9 (or thereabouts Raspbian) to version 12 on the RPi Zero without too much trouble. Yes in a couple of services I had to tweak the configuration, but everything got up nicely. I'm also... [Read more]

krzbor 06 Jan 2025 22:17

I have Linux with OMV. It has been running for over 8 years now and I think it will still work. It serves mainly as a us and web server. It has a passively cooled Atom. Whether it will last 15 years I... [Read more]

@GUTEK@ 07 Jan 2025 19:17

Among other things, this is why Docker and the like were created, so that you don't have to struggle with dependencies for a particular version of an application. Just fire up a ready-made image with whatever... [Read more]

xury 07 Jan 2025 19:30

I, on the other hand, am in favour of native installations of everything I can. Of course HA can't be installed, so it's in a container, as well as a couple of its add-ons that don't come natively (e.g.... [Read more]

krzbor 07 Jan 2025 21:33

Personally I appreciate virtualisation. Its biggest advantage is the ability to easily make a copy of a virtual machine. The QCOW2 format is quite stable over time which makes it easy to move machines... [Read more]

kuncy7 31 May 2025 22:00

What I am interested in is not how to recover, but how to change! I have several clients configured and would like to connect them to a new HA installation with the MQTT add-on. It seemed to me that... [Read more]

%}