1Remove any device from home assistant

I’ve now been using home assist­ant for sev­er­al years and most of the early chal­lenges and learn­ing-curves have been over-come. How­ever, there has been a long-stand­ing issue that is a con­stant frus­tra­tion — remov­ing old devices does­n’t have a stand­ard approach and in some case is impossible from the GUI. There is a way though.

Devices (and entit­ies) can be deleted (or mod­i­fied) the manu­al way dir­ectly from home assist­ant sys­tem files. Some of the files which you might need are called core.device_registry and core.config_entries core.entity_registry. These are loc­ated in \config\.storage\ whcih (as a win­dows user) I access via the “Samba Share” super­visor add-on. If you don’t have super­visor you may need to access these files a dif­fer­ent way.

I used this to remove a dead Drayton Wiser TRV from HA — by delet­ing the whole rel­ev­ant sec­tion from core.device_registry…

{
"config_entries": [
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
],
"connections": [],
"identifiers": [
[
"wiser",
"iTRV-2"
]
],
"manufacturer": "Drayton Wiser",
"model": "iTRV",
"name": "Wiser iTRV-Dead",
"sw_version": "xxxxxxxx",
"entry_type": null,
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"via_device_id": null,
"area_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"name_by_user": "Dead TRV",
"disabled_by": null,
"configuration_url": null
},

And also 2 sec­tions (for the 2 asso­ci­ated entit­ies) from core.entity_registry (I haven’t shown these as they should be obvi­ous — the format is the same as above with the sec­tions enclosed by curly-braces)

Other uses

I have also used changes to core.config_entries to change the IP address of an onvif IP cam­era which home assist­ant was refus­ing to con­nect to after the IP changed. The same is no doubt pos­sible for oth­er devices.

Leave a Reply

One Comment

Rripp2003

Thanks ! it works for me !
On debi­an, use /usr/share/hassio/homeassistant/.storage
I have suc­ces­fully delete 7 old devices kept in agent­dvr intégration

Reply