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.
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.