Where are my entities used

Hi all,
I aim to clean up my Home Assistant instance by removing unused helpers, sensors, and other entities. However, I need a foolproof method to verify that an entity is truly unused across:

  • Automations (including templates in conditions/actions)
  • Dashboards (all card types, including hidden or conditionally visible cards)
  • Scripts, scenes, and blueprints
  • Custom integrations or add-ons (e.g., HACS items)
  • Indirect references (e.g., groups, areas, or templates in other entities)

What would you suggest me to do ? Is there any tool that could help me with that ?
Thanks in advance!

Assuming you have never used device ids, do a global search of the /config directory in VSCode for the entity_id.

This will find occurrences in automations, but not in dashboards…

That’s not true, use vscode and make sure you include hidden folders. Only pay attention to the dashboard files in config/.storage, ignore the rest.

2 Likes

.storage was hidden! Thanks!

Also the third party integrations Spook and Watchman do a good job of finding entities you have used that don’t exist.

Spook will generate repairs in real time for dashboard and automation entity issues.

Watchman can generate a detailed report with line number where the unknown entities occur in your config.

1 Like

Thanks for mentioning spook and watchman, i am already using these integrations, but i am searching for a solution to track down if a helper is used somewhere or if it can be deleted… I have a bunch of helpers in my installation that were created over time and a lot of “ghosts” that were no longer needed… For a cleanup process it would be nice to know if this helper is used somewhere or if it can be deleted…

What would all the places be where an entity could be referenced ?

Automations (/Blueprints)
Scripts
Dashboards
Template sensors
Possibly other integrations, like generic thermostat.

If you open the helper’s more info pop-up and click on the three dots icon in the top right of the card there is a “Related” option that will show you which automations and scripts it is used in.

1 Like

oh, i didnt know that! This is also quite helpful! Thanks!

Be aware that the “Related” dialog will only show automations, scripts etc. where an entity/device id is explicitly/directly fed into an action/trigger/condition. If say the entity id is instead stored in a variable, and then fed into an action through a template, it will not be registered as Related.

For this reason, when I design blueprints where I only reference the entities through templates, I now add some dummy actions tagged with enabled: false at the end of the automation where the entity id’s are explitly inserted with !input so that they will show up as Related.

1 Like