Hi Folks,
I replaced a broken Shelly device and now there are orphaned entities.
How can I remove them?
I want to use their names again.
Hi Folks,
I replaced a broken Shelly device and now there are orphaned entities.
How can I remove them?
I want to use their names again.
Restart home assistant. Then go to Configuration / Entities and find and delete the orphaned entities.
I tried that allready.
I canât delete them, because I canât pick them.
Can you screenshot what you mean?
In my screenshot, Iâm trying to remove the first two entities. Barely noticeable the checkboxes for these two entities appear just a little duller than the others. The checkbox for the entity I want to remove is disabled. Even when selecting all entities, the checkbox is not checked. When I try âREMOVE ENTITYâ nothing happens.
How about if you go to Configuration / Devices and Services/ Integrations find the removed Shelly device there and delete its instance of the integration (three dots icon)?
So, this is totally a hack, but I think most of you would find it helpful. I was able to remove some of my orphaned entities simply by inspecting the HTML and removing the "disabled attributes(s) from the DELETE button when viewing an entity popup. Iâve uploaded a video to demonstrate.
Brilliant. I still have this happening sometimes and itâs frustrating especially when I want to rename an entity id to the same name as one of these, but it usually resolves on its own. Thing is I canât figure out what causes it to straighten itself out. Seems like a few reboots? Mine are mostly MQTT sensors in configuration.yaml and not from an integration.
Your video would have been a lot more useful with some narration or a written script because itâs almost impossible to follow a schizophrenic mouse jumping all over the page.
I have two which are absolutely âundeletableâ. E. g.:
On the second I choosed to delete it. Now it is still there but in the same state as the one showing above.
Recorder - Home Assistant also did not work.
Restarted HA, didnât change at all.
Seems they are some kind of âghost entitiesâ, as they are not even showing up in the entity registry anymore:
So how to delete them?!?
Update: it seems that
a) restarting HA further times removed one of the two entities and
b) a frontend caching error occured, which is why the deleted one was still shown (custom:auto-entities)
Letâs see what happens with the remaining one.
I see plenty of entries inside âcore.entity_registryâ inside âdeleted_entitiesâ section. like this:
"deleted_entities": [
{
"config_entry_id": null,
"entity_id": "input_boolean.testing_every_minute_controlled",
"id": "688ff009f7f761760016408593446101",
"orphaned_timestamp": 1688858690.9584615,
"platform": "input_boolean",
"unique_id": "testing_every_minute_controlled"
},
{
"config_entry_id": null,
"entity_id": "cover.kitchen_window",
"id": "54b304c71227525f81a4fdb2b660c052",
"orphaned_timestamp": 1688950399.840828,
"platform": "demo",
"unique_id": "cover_1"
},
{
"config_entry_id": null,
"entity_id": "cover.hall_window",
"id": "d82d64ff2a0755315cbb7d79a3899be8",
"orphaned_timestamp": 1688950399.840828,
"platform": "demo",
"unique_id": "cover_2"
},
These entities are not listed in Settings â Entities list.
Currently there are 99 entries:
I wonder what is a purpose of this âdeleted_entitiesâ section?
itâs a complete mess when it comes to orphaned entities. users that arenât comfortable editing core files can almost be locked out of adding devices with the silly âdevice already configuredâ error.
seriously lacking.
There is a new integration called watchman that helps to some extent with this issue. Give it a shot!
Thank you, I know about this integration, I find this integration GREAT. But I keep it DISABLED and run it periodically - to track âmissingâ entities only; to monitor âunavailableâ & âunknownâ using my own methods.
For me the whole point is not only about âhow to track & remove orphaned entitiesâ - but about âWTH these orphaned entities are kept in core.entity_registry?â. Seriously, I think integrations should âclean upâ the entity registry; for instance, there are orphaned entities for some âXYZâ integration - even when this integration is deleted.
Yes that is why I said âto some extentâ. I believe the safest way is to give them new names as having a â1â or something like that appended to the old name you prefer. Then, after the DB has cleared away the unused old ones, you would rename them. (I think that is typically 3 months? But I cannot remember.)
From what I understand it is a tricky and dangerous way to actually go into the master HA DB and make the changes manually, but from what I understand one little error in there could make your HA unuseable⊠I would loove to dig into the guts of how all that happens - but donât even have the time
This is a new thing for me, never heard about that.
What I believed is:
â assume some sensor.xyz is NOT excluded from Recorder;
â the Recorder keeps history for this sensor for some period (âpurge_keep_daysâ, 10 days by default now);
â assume this sensor is deleted;
â we cannot see a history for this deleted sensor;
â in 8 days this sensor is restored (same entity_id);
â we can see a history for this sensor with a gap=8days;
â assume this sensor is deleted again;
â in 10 days there will be no history for this sensor in DB.
But as I already said, removing these âorphanedâ entities is not a problem for me (so far at least), I just wonder why it happens in general.
Possibly keeping info about deleted entities in Entity Registry is a good thing - but it should have some documented logic.
Have you tried to use the delete all orphaned entities service from the Spook Addon?
First itâs an integration (not an addon), second Iâm not sure if it adds actual benefits or is just a sarcastic way of ruining ones HA. That introduction and large parts of the documentation reads just too funny. Third I think the not that dangerous stuff with benefits for many users could be easily added to core, as itâs maintained by Fraenk.
Anyway, interesting to see what this service does⊠(I wonât test this ).
Sorry for mixing up addon and extension.
I stumbled upon this one completly accenditly. In HACS i first thought itâs something for halloween, until i noticed that is one awesome swiss army tool made by Frenck himself.
Have you tried to remove a few hundred orphaned entities from the UI? Sure itâs dangerous to just call the service - it will indeed remove ALL currently unavaivable items - i guess thatâs why itâs not just added directly into the core. But i guess people having such issues are more on the experienced side. Backup is easy to do and strongly recommended.
It helped me to get rid of a few thousands (honestly) of BLE tracker entites which have been added mainly from the random Airtag trackers over time. It completly broke my frontend. The known_devices file was 17 MBâŠ