How to remove entities without a unique_id? Where are they?

This worked for me… thanks again.

I have also have an entity, created from HACS, that I cannot remove. Interestingly the entity is not displayed when I goto settings > devices > entities but is offered as an entity when adding to lovelace. The entity has not been used for many months. I ran recorder purge for it. Still there.
How can I remove it and isn’t this an inconsistency in the database? Is there possibly a service to check this and clean it?

Thanks Bogey.

This did not work for me however. Any suggestions?

FYI: I run HA on top a deconz system. Deleting the troublesome entities from deconz, reloading (from deconz), deconz:deleting orphans and recorder:purging still leaves the ghost entities :confused:

I have a lot of (maybe 30000?) sensor ble entities without unique id and with not (anymore) existing mac adresses. Recorder Purge entities does not delete them. I would be glad if anyone had an idea …
Many Thanks, Michael

Just tried to watch the Database (home-assistant_v2.db) with SQlite DB Browser. Can’t find the unused entries in “state” folder, but they are all listed under “event_data”. Can I delete them from there and might it help?

Damn I have exactly the same problems! Any solution for it. With Recorder: Purge Entities it doesnt work.

PS:
Clear the browser cache works!

3 Likes

Hi ,

Yes it helped , log out/log in removed the ones.

Thanks

3 Likes

After purging the entity, log out/log in will make it go away.

Thanks guys.

2 Likes

The question still remains; “How do you purge an entry that does not appear in the list of entities or when typed out?”

For me I went to “Developer Tools”, “Statistics” tab, then clicked “Fix Issue” on all the entities without unique ID’s.

4 Likes

Thanks a lot,
I just had to clear the cache

1 Like

For me, the devices were not in the known_devices.yaml…

I had removed them from the configuration.yaml, and the entities persisted.
Restarting HA in the interface didn’t work… UNTIL I ran “reboot” from the terminal.

After that they were gone.

1 Like

Thanks- that’s a tool that I didn’t know about.
But my orphan device is not on that list.

1 Like

I had the same issue after creating an entity with the REST api. I was able to remove this by posting a DELETE event:

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://your-homeassistant.example.com/api/states/sensor.example

More about the REST api in the docs, although this delete action is not mentioned there: REST API | Home Assistant Developer Docs

10 Likes

This worked for me as well

The entities I want to remove dont show up under statistics.

I had added a few things in config yaml and when I removed them they would not go away as entity and had no id and so on.

The solution for me was to use addon studio code server and going into known devices yaml and remove them, save and reboot and they were removed.

1 Like

known_devices.yaml is deprecated and not used anymore so you should be safe with just removing the file (and since there is theory and practice - I would just make a copy just in case :))

worked for me, thanks so much!

Worked for me!