How to remove unavailable entities?

It is a hidden folder under /config.

1 Like

Hi folks
I’ve just installed HA and experienced a similar problem. Google lead me to this tread.
Nothing sugested here seemed to help me so i fumbled around in my HA panel for some time when it dawned on me that the entities i tried to remove had to be remnants from earlier app configurations.
More specific i had 3 rooms showing up in my Hue configuration. Those entities where write protected so no deletion possible. Solution was to install Phillips Hue app. Then in the app i clicked on the info tab in the Hue Bridge list. One option under this setup page was wipe / cleaning of data from the Hue bridge.
Cleaning the hub data removed the write protected entities from my HA setup. Hope this can be of some help for other stumbling into the same problem :smiley:

5 Likes

We could do with a “flush entities” or “cleanup” button to remove unused ones that have been unavailable for some time inside HA somewhere.

18 Likes

sounds good to me

Such a feature would be great.

I had the same issue described in this thread.
I solved it by restarting the server (settings > Server Control > Server management > restart).
After reboot the “ghosts” were gone (I couldn’t find them in the suggested .storage/ files either).

I went through my core.entity_registry but some of the old orphan entities that still show up in HA definitely ARE NOT in there. Nor in MQTT. There’s also no known_devices file anymore.

There must be some other database that holds these old entities.

I found some in the customize folder. Can I edit this folder?

I had one of these orphaned entities that I too could not remove (no remove button). In my case, it was associated with a switch that controlled a light which I configured using the “Light Switch” platform (ref. Light Switch - Home Assistant).

light:
  - platform: switch
    name: "Christmas Lights Outside"
    entity_id: switch.wemo_outdoor_268

Once I removed these lines from my configuration.yaml file and restarted HA, the orphaned entity was gone!

2 Likes

Did you ever find a solution to this and find where they’re listed? I have a bunch that are causing confusion. I’ve searched the whole config folder using text search including storage to try to find them to no avail.

Edit: I found them in switch.yaml duh.

1 Like

For me this was an issue with MQTT hanging onto entities through reboot. My steps:

  • delete Node-Red flows with MQTT
  • reboot
  • open settings->Devices&Services
  • click core-mosquitto devices
  • delete each device (May have to reboot a couple of times before they’re all gone)
  • reboot
  • re-install my Node-RED graphs

On my case I use the mqtt explorer (from windows play store) to connect with broker crendetials and delete them from esphome. after that I restart esp dedevice and is working.