Hi for the life of me I swaer I didn’t change anything. My home assistant instance used to be accessible at 192.168.0.9:8123, now for whatever reason I can only reach it at http://homeassistant.local:8123. But now it not only turns out that the the address has changed and I don’t know what it is, but also I have forgotten the password and user name? I doubt very much I would have changed the default user name and passoword, so does anyone remember what this is? Thanks.
There is no default password or username. You have to set them during the onboarding process.
Look in your router for the IP address.
When you get back in, make sure you have set a static IP address.
If you can reach homeassistant.local, you should be able to figure out the IP address by running ping homeassistant.local
on your computer.
I was able to identify the IP address doing this, yes. But it has been so long since it asked for a password (about a year), I’ve totally forgotten what I must have done. There must be many people who end up in this position? Why isn’t there a simple way to recover/reset the password? I’ll read what has been posted, thanks.
Warning: this is an ugly hack and is by no means guaranteed to work.
If you were signed in before the IP address of your server changed, you can try this:
- Go to the original URL of your home assistant instance. It will fail to load. Press
F12
to open developer tools in your web browser. I’m using Firefox, but it should be similar in Chrome.
In theStorage
tab underLocal Storage
, locate a key namedhassTokens
and copy it’s value. - Go to the new URL, open developer tools, navigate to Local Storage again and create a new key named
hassTokens
with the value you copied earlier. - Try refreshing the webpage. If everything worked, you should be logged in.
I have decided to just give up. There’s too much messing around to do, so I have bought a 1TB mSATA drive and a usb adapter and I’ll just install another instance of home assistant to this. (My home assistant enclosure allows for an MSATA SSD). I’ll just rebuild the whole thing with the new SSD and use the extra capacity of the SSD to run the Plex Media server integration I guess. I will also write the user name and password I choose on the bottom of my enclosure this time. I hope it doesn’t happen again though.
Hi sorry, what do you mean open developer tools? Where do I get these? Thanks.
You press F12
on your keyboard, or right click anywhere in the webpage and click on Inspect.
OK I’ll give that a go, thanks.
“No data present for selected host.” I don’t think I have any choice other than to start again? But surely the developers should make resetting your password simpler?
How did you install home assistant? Do you have access to it’s filesystem?
It’s on a MicroSD, so if you’re asking if I can plug the MicroSD into anything and read it/edit it, the answer is yes, probably.
Just to make sure, you are getting this error on the original URL, not the new one, right?
Edit: I asked because if you were getting this error on the new/working URL, you would just click the +
button in the top right corner of developer tools and add the key yourself.
If you have write access to the filesystem, you could try this:
- locate
.storage/auth_provider.homeassistant
in your Home Assistant config directory. Make a backup before changing anything! - Choose a new password and run this simple python script:
#!/usr/bin/env python3
import bcrypt
import base64
import getpass
password = getpass.getpass('Password: ')
hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt(rounds=12))
hashed = base64.b64encode(hashed)
print(hashed)
Copy the resulting hashed password (without the leading b'
and trailing '
) and paste it into the auth_provider.homeassistant
file in place of your current password.
Start Home Assistant and see if the new password works.
Please note that unlike the previous method, I did not test this one at all. But from looking at Home Assistant’s source code, I think it should work.
Waw that is a nice hack, it should definetly work :>
So I will probably give that a go in the morning. But I’m such a n00b I don’t know how to run a python script? Everyone needs to start somewhere I guess. Could you please advise?
Copy the script from my previous post and save it to a new file named password.py
. Then open a terminal in the same directory and run python3 password.py
(or python password.py
if the previous command fails).
You will need a Python interpreter. If you are on a GNU/Linux operating system, it is probably packaged by your distribution and you can use a package manager (such as apt
) to install it. On Ubuntu, the required commands would be
sudo apt update
sudo apt install python3
If you are running Windows, you’ll need to download Python from Download Python | Python.org.
[quote=“jebus2504, post:4, topic:321610, full:true”]
I was able to identify the IP address doing this, yes. But it has been so long since it asked for a password (about a year), I’ve totally forgotten what I must have done.[/quote]
In Chrome, you can just go to Settings / Autofill / Passwords and look up what it was using before.