Find Where a Home Assistant Entity Is Used
See every place an entity id is used before you delete or rename it: the file, the line and the line itself. Choose your config folder (YAML files, packages, dashboards and the .storage folder) and your Node-RED flows. Your files are read on your device and never uploaded.
Choose your files
or drop them anywhere on this page. Add Node-RED's flows.json the same way, before or after.
Your browser may say it will "upload" a folder: that is its usual wording. The files are only read here, on your device. secrets.yaml is never opened.
Rename preview
See every line that would change if an entity id were renamed, and download a changed copy of each file. Your own files are not touched.
Files
What it reads, and what it does not
- YAML. configuration.yaml and every other .yaml file in the folder: its includes, packages, automations, scripts, scenes, templates, groups, customize, YAML dashboards, blueprints and ESPHome configs.
- The .storage folder. Dashboards made in the UI, helpers made in the UI (groups, templates, thresholds and the like), people, the energy settings and the entity registry.
- Node-RED. A flows file: flows.json from the add-on, or an export of some flows. Node settings and function code are both read.
- Never opened. secrets.yaml, logins and tokens in .storage, the database, logs, custom_components, www and backups. In core.config_entries only the settings of helpers are read, never an integration's login.
- What counts as a use. Every place the id is written: entity lists, targets, triggers, conditions, templates such as states('sensor.x') or states.sensor.x, card settings, Node-RED nodes and code. Ids in comments are listed and marked as comments. Action names such as light.turn_on are not entity ids and are left out; a script run by its own name, such as script.morning, counts as a use of that script.
- Flags. With the .storage folder included, an id is flagged when something uses it but it is not in your entity registry and not defined in your YAML. That is usually a deleted or renamed entity, or a typo: the cause of an "unknown entity" or "Unable to find referenced entities" message. Without the registry, ids that appear in one place only are flagged, which is a weaker hint.
- What it cannot see. Ids a template builds from pieces, such as "sensor." ~ name; anything kept only in Home Assistant's database; and places outside these files, such as voice assistant settings and other add-ons.
- Rename preview. It changes only the id's own text and lists everything else for you to check. The entity registry is never changed here: rename the entity in Home Assistant first (Settings, Devices and services, Entities), then put the changed files back. Stop Home Assistant before you put back a file from .storage, or it can write its own copy over yours.
- Nothing is uploaded. After the page loads it works offline. Tested in Chrome, Edge and Firefox. Safari should work the same way; if choosing a folder does not work there, choose the files instead. Not affiliated with Home Assistant or the Open Home Foundation.
Questions
How do I find where an entity is used in Home Assistant?
Choose your config folder above, then type the id in the search box. Each place is listed with its file and line, and a short path to it: the automation's name, the dashboard, view and card, or the Node-RED flow and node.
Home Assistant warns about an unknown entity, or "Unable to find referenced entities". Where does it come from?
Search for the id the message names to see every file that still uses it. With the .storage folder included, every id that is used but missing from your entity registry is flagged, so the flagged list shows all of them at once.
Does it read dashboards made in the UI?
Yes. Home Assistant keeps them in the .storage folder, in files named lovelace and lovelace.dashboard_ followed by a name. The folder is hidden on some computers: on a Mac, press Cmd+Shift+. in the file picker to show it, or choose those files by hand.
Where is my Node-RED flows.json?
With the Node-RED add-on it is in the add-on's own config folder, addon_configs/a0d7b954_nodered/flows.json (older versions kept it in the node-red folder inside your config). You can also export your flows from Node-RED (Menu, Export, All flows, Download) and add that file here.
Is it safe to delete an entity that is not used anywhere here?
Nothing in the files you chose depends on it. Other things still can: its history and statistics, voice assistants, and add-ons or integrations whose settings are not in these files.
Can it rename an entity id everywhere?
It shows every line that would change, before and after, and gives you a changed copy of each file. You put the copies back yourself, after renaming the entity in Home Assistant.