I have four orphaned entities. Under Devices&Services-Entities they are displayed as Unmanageable and belonging to Sensor/Binary-Sensor integrations. (Zigbee door sensors leftovers)
They cannot be selected and deleted. I found few posts in this forum describing such problem. None of the suggested solution/work-around could help me.
In other words, I didn’t find any way to delete them with UI.
It is not only cosmetic problem because they appear as ghost entried in a card using following:
include:
- name: attributes.device_class
value: battery
The question again is: how to remove them?
Another, maybe more important questions are: why do I have them? They don’t have unique ID. If it is bad,
why am I allowed to create such entities? What can I do to prevent this?
Did you try to empty browser cache, hard-reload HA? In 90% of those cases, it’s just the browser, which is just having them in cache and display them, even if not really existing anymore.
I have 2 integrations that create a lot of orphaned entities, although I cannot prove that they have any impact on functionality/performance… I just want then ‘out’. I created the below script which I then call periodically from an automation.
There is an action to delete all orphaned entities but I had issues in the past (no longer tested as below is fine for me)
They are gone!
The server was rebooted this morning. Then I checked and they were there, in Devices&Services-Entities
and also in my “Battery status card”, before I wrote my initial posting.
I went away, three hours later I am back, read your answers, access my server with another browser: they
are not there. Back to my “old” browser - they are away!
It must have something to do with browser’s cache.
Learned something!
A reboot does not delete orphaned entries, at least, it does not with me. Mind you…there are so-called orphaned entries and old/outdated entries…so maybe that it is the diff ?
A word of caution: Use the script with extreme caution, making a full backup beforehand in case it goes rogue. Make sure you modify it for your specific requirements - do not use the entities listed without knowing what you are doing. Here be dragons.