I have a Home Assistant blue physically connected to a keyboard and screen and am at the OS CLI. My Core wont start because there is a mistake in my device_registry.
Where is my device_registry located and how can I edit it from the command line?
I have a Home Assistant blue physically connected to a keyboard and screen and am at the OS CLI. My Core wont start because there is a mistake in my device_registry.
Where is my device_registry located and how can I edit it from the command line?
For future reference:
On the second terminal (ctrl+alt+F2) you can login with root. Then navigate to /mnt/data/supervisor/homeassistant/.storage and there you can use VI to edit files.
My problem is solved!
How did the device_registry get messed up in the first place?
Manual editing: trying to get rid of devices that cannot be removed but are taking up names that need to be assigned to other devices
How did you know how to manually edit it to break it and then not know how to manually edit it to fix it?
Why are you asking these questions? Are you trying to point a finger or is there something useful behind your line of questioning?
To answer your question: You can edit using the configuration editor while core is running. Once you then restart, you can no longer start core and so you cannot get back to your editor. My main challenge here was locating the files on the filesystem…which then allowed me to restore them pretty quickly.
general curiosity.
Cautionary tale for others?
Don’t manually edit your device_registry or other .storage files unless you really know what you are doing.
Those files are not meant to be user editable for a reason. This reason.
I know. But be that as it may be, after years of using HA and trying different sensors, replacing broken dimmers etc, you end up with a lot of ghost entities and devices that are not removable any other way. So some clean up is needed once in a while.
fair enough.
But I think I’ve only ever needed to manually edit those files one time in the over 5 years I’ve used HA.
As a great man once said “With great power comes great responsibility”.
Use sparingly.