"Person entity not found" - screwed up the user account configuration

Hi there,

I´m pretty new in the whole world of smart home end even newer in the Home Assistant arena. I started with HassOS for testing purposes. During onboarding I choosed a user name (“admin”…) I wanted to change afterwards - which seemed to not be possible using the UI.

So I scanned the /config/.storage directory and found some config files associated with user management like

  • (!) auth
  • (!) person
  • (!) auth_module.totp
  • (!) core.entity_registry
  • auth_provider.homeassistant
  • frontend.user_data_(LONG-ID)

Where the first four (bold) are the most relevant ones. So I renamed the user account in those files (I think only in “auth” and “person”), restarted HassOS and used the new username for logging in (still owner).

BUT that (stupid) action seems to have broken something. E. g. now
a) the person badge shows “n. a.” (not available) even the device tracker associated to the person entity states the person is at home
b) when clicking on the person badge I get a message “entity not available, it´s widowed…”
c) the entity page shows a “recovered” state next to the person entity

So my question is: what is the easiest way to fix that (without loosing data)?

  • Can I fix the obviously missing link between the user accound and the person entity?
  • Can I redo the onboarding without loosing all my data?
  • Is there some other config storage next to the above mentioned files?

I already tried the procedure in https://www.home-assistant.io/docs/authentication/#lost-owner-password but it didn´t help.

Meanwhile I build up many things and don´t want to start from scratch with loosing all my data (entity/device/integration data, history, lovelace dashboards, …) so I´d prefer to fix what I stupidly crashed :frowning:

I searched the whole community and documentation which only provide the “lost password” information, nothing related to my situation unfortunately. I hope this forums section is fine for this issue by the way.

When’s the most recent snapshot? I would just revert back to that.

Good idea but those two existing are either too new (include issue) or too old (loose data).

OK, next plan…

Create a new user account with admin privileges in the correct name. Log out of the broken one and login as the new one. Delete the old admin account and related person completely. Create a new person for the new account and add associate your device trackers with it.

If there’s not an easier way (e. g. having a look at the SQLite database and probably fix it there) I’d go that way.

  1. Create Snapshot (backup)
  2. Create new user (problem: new name = old name currently so I try to first rename the current/old one, same for person)
  3. Delete old one
  4. Create new person, link with new account
  5. Assign devices to new person
  6. Test presence status of new person account

What would I need to reconfigure after that? Lovelace-Dashboards will be unaffected?

Yeah, so long as the entity on your lovelace is the same entity_id at the end of it there shouldn’t be any issues. Worst case you’ll just have to update whatever views have your person entity on with the new id.

Update: I created new person and new user account.
BUT: Now it´s not possible to delete neigher person nor user account using the web interface.

What the…? :frowning:

Got it:

  1. Set “is_owner” in /config/.storage/auth from true to false for old account
  2. Set “is_owner” in /config/.storage/auth from false to true for new account
  3. Restart HA
  4. Delete old person and user account
  5. DONE.
1 Like