Find and remove unavailable entities
In Home Assistant, go to Settings > Devices & services > Entities, filter on the status Not provided only, select them all, and choose Delete selected. Those are the entities no integration provides anymore. Check first that all your integrations started: one that failed leaves its entities looking not provided too. An entity that is only Unavailable still belongs to a working integration: bring its device back, or delete the device.
Spook adds an action that deletes every entity that is no longer provided in one go, a repair for the entities a removed custom integration left behind, and repairs that tell you which automations, scripts and dashboards still use what you deleted.
Unavailable, or no longer provided?
Home Assistant has two kinds of unavailable entity. Only one of them can be deleted.
- Unavailable. The integration still has the entity, but cannot reach the device right now. A dead battery, a plug somebody pulled out, a lamp switched off at the wall. When the device comes back, so does the entity. Delete it, and the integration adds it straight back.
- Not provided. No integration provides the entity anymore. The device was removed or replaced, or the integration stopped making that entity after an update. Home Assistant keeps the entity and its settings, in case it comes back. Open one, and it says: "This entity is no longer being provided by the ... integration. If the entity is no longer in use, delete it in settings."

The second kind is what piles up over the years. Those are the ones to remove.
Find unavailable entities
- Go to Settings > Devices & services, and open the Entities tab. Or use this button:
- Select Filters, and open Status.
- Clear Enabled. Home Assistant ticks it by default, and it keeps every other entity in the list.
- Pick Not provided for the entities no integration provides anymore. Pick Unavailable for every entity that cannot be reached right now.
Rather have a list? Go to Settings > Tools > Template, and paste one of these.
Every entity that is unavailable right now:
{{ states | selectattr('state', 'eq', 'unavailable') | map(attribute='entity_id') | list }}
Only the ones no integration provides anymore:
{{ states | selectattr('attributes.restored', 'defined') | map(attribute='entity_id') | list }}
Disabled entities are in neither list. They have no state at all, so they are not unavailable either.
Lots of unavailable entities of one device? Then it is the device that is gone, not the entities. Spook's unavailable devices card lists those, one row per device, longest gone first.
Delete entities that are no longer provided
Check Settings > Devices & services first. An integration that failed to start leaves all of its entities looking not provided, while nothing is wrong with them. Fix or reload that integration before you delete anything.
- In the Entities tab, filter on Not provided only, like above.
- Select Enter selection mode, and then the box at the top of the list. That selects them all.
- Open the menu with the three dots, and select Delete selected.
- Confirm.

Home Assistant only deletes what it can: entities no integration provides, and helpers you made in the UI. Anything else in the selection stays, and it tells you how many it can delete. Filtered on Not provided, that is everything you selected.
Entities of a custom integration you removed
Take a custom integration out of custom_components, and its entities stay behind, not provided, for good. Nothing in Home Assistant points them out.
Spook does. It raises the Entities of an unknown integration repair, with the entities the missing integration left behind. Still using it? Install it again. Done with it? Delete those entities, like above.
Set the integration up in the UI? Then its entry stays behind on the integrations page too, and the repair leaves its entities to that entry. Delete the entry, and its entities go with it.

Delete all unavailable entities at once
Spook adds the Delete all orphaned entities action: homeassistant.delete_all_orphaned_entities. It deletes every entity that is no longer provided, in one go, from a script or an automation. Same rule as the button in Home Assistant: an entity that is only unavailable stays. A disabled entity stays too, as it has no state to go by.
action: homeassistant.delete_all_orphaned_entities
To run it once:
- Make sure every integration you care about is running. Check Settings > Devices & services for one that failed to load.
- Open the action in your Home Assistant.
- Select Perform action.
There is no undo, and no list to check first. Put it in an automation that runs on a schedule only if all your integrations start reliably. One that fails at the wrong moment takes its entities with it.

When the entity is still provided
An entity that is unavailable, and not marked as not provided, cannot be deleted on its own. The integration would add it back. Three ways out:
- The device is gone for good. Open the device, and select Delete in its menu. Not every integration offers that. When it does not, the integration's own documentation says how to remove a device, often in the app of the device's maker.
- The whole integration is gone. Delete the integration entry under Settings > Devices & services. Its devices and entities go with it.
- It is off on purpose. A Christmas tree in July. Disable the device or the entity instead. Home Assistant stops tracking it, and it no longer shows up as unavailable. Need that from an automation? Spook's actions do it.
Check what still used them
Deleting an entity does not change the automations, scripts and dashboards that used it. Home Assistant runs them without complaining, and the step with the missing entity does nothing.
Spook notices. Every automation, script, scene and dashboard that refers to an entity that no longer exists gets a repair in your repairs dashboard, like Unknown referenced entities. Open it, and it shows what is missing and where. New to repairs? Fix your first repair walks you through one.
Clear their history
A deleted entity leaves its history behind in the database. That history does nothing for you anymore, and takes up space.
- Long-term statistics. Spook raises the Orphaned long-term statistics repair for statistics no entity belongs to anymore, and clears them for you from the repair.
- Recorded states. The List all orphaned database entities action,
homeassistant.list_orphaned_database_entities, lists every entity the database still holds history for, and that has no state right now. Its page has a script that purges that history right after. That list also holds entities that are only disabled, and those of an integration that did not start. Check it before you purge: there is no undo.
Know when something drops off
Cleaning up once is good. Hearing about it when it happens is better.
- The unavailable devices card and badge show the devices that dropped off, on your dashboard, and are gone when everything is there.
- The Entity came back trigger,
spook.recovered, fires when an entity returns after a real absence. The Entity fell silent trigger,spook.stale, catches the sensor that stopped reporting without ever going unavailable.
Removing
How to remove (uninstall) Spook from Home Assistant. What to check first, the steps to take, what goes with it, what stays, and what stops working.
Disable an integration
Home Assistant has no action to disable an integration. Spook adds one, and one to enable it again. With examples, and what to use instead when you only want it quiet.




