Abandoned and orphaned entities

I have a large number of entities that are orphaned or otherwise no longer valid entities - most via old esphome projects that have fallen by the wayside over time. I know I can go into the Developer section and click the info icon for each one and remove it but I’m wondering if there’s a better way to do a bulk cleanup either via editing a config/text file somewhere or via some addon that allows for easier cleanup that I’m just not aware of?




I’d love to know this, too. I’m getting growing numbers of chromecast speaker groups I would like to be rid of without tediously doing them one at a time.

New to HA, and seem to be experiencing the same thing. Guessing maybe there’s a config file I can edit ?

an old post but id thought id bump it to ask the question again if anyone has found a way to mas remove orphaned entities?

Me too…Any thoughts on that?

Me too,
for an android phone doesn’t have a unique id.

Also looking for information as to where I can edit this.
I have a ubiquity device that has a sensor that has lost its unique id for rx.

Bulk actions are available in Settings → Devices → Entities (choose entities from the tabs across the top). Then you can sort by status to find all your unavailable ones listed together; check the boxes to their left, then click “remove selected.”

That doesn’t always work. I definitely have entities in the Entities json that can’t be removed like that. They don’t show up there. But home assistant still sees them, because I get entity name still in use errors

For me, the only ones that I can’t remove that way are ones I have manual configuration entries for in configuration.yaml, groups.yaml, etc. But bulk removing those is easy - just remove those configuration lines and reload the relevant group/ template/mqtt entities.

Does anyone know how to programmatically disable/enable entities? I’ve got some that periodically go unavailable and this is a quick fix I’ve found. Thinking of automating the process though when they’re detected as unavailable.

Check this out.