How to remove unwanted entities?

Thanks for this!! It’s the only thing that worked for me after attempting several other solutions. Apparently this bug still exists in 2024.7.2 and was driving me crazy! In my case, it was a light group that I couldn’t seem to remove but it’s all good now.

Hi @francisp ,
I trying to remove an anniversary item, that i added with the anniversary service. But I have absolutely no luck:

I always did a reboot after each of the things I tried:
Remove as above suggested → Still there
deinstalled integration → reboot → remove as above → still there

any idea, where this can be deleted?

thank you
Juergen

1 Like

Note to my future self: Use a different browser. Seemed to be a caching problem. With another browser everything was as expected. Sorry.

all the best
Juergen

2 Likes

Just to let you know, since 2024.8
Services is renamed to Actions
So now is
“Developer tools” → “Actions” Tab → Service: “Recorder: Purge entities”
Thanks to @freshcoast

3 Likes

I have a hass OS container in unraid. can only (to my knowledge) edit the files while HA is running (using the terminal and VI). However, after editing and removing the entity entries, restarting HA… all that is deleted is back again!
How can this be solved?

My post pointed to a post of someone else. However, post 6 seems to be the solution to the initial post. That might be the way to go.

I removed all entries in the known-devices, but that did not help

Problem solved. You need to go to the Ha CLI (VM console of the virtual Machine in Unraid). Then issue the command

core stop

With that, HA shuts down.

Then

login

to go to the operating system

The files can be found in

/mnt/data/supervisor/homeassistant/.storage

Edit the files as per above, exit the operating system and re start HA with

core start

and the orphaned entities are gone.

1 Like

Just to confirm, I was having the same problem.

I just used Samba share.
Opened the folder: .storage
Located the file: core.entity_registry and made a copy onto my local drive just for safety.
Edited the original file using Notepad in Widows, but any text editor that doesn’t reconfigure the files spacing and indentions will work.

All of the orphaned entities are listed there. They are a few lines each. Below is a sample of the ones I deleted.

00:00","entity_id":"sensor.motioneye_version","id":"ec731b305b32e8f13afa2b01a8390b15","modified_at":"1970-01-01T00:00:00+00:00","orphaned_timestamp":null,"platform":"hassio","unique_id":"a0d7b954_motioneye_version"},
      {"config_entry_id":"d1b29c5e858c045905b8863d47ddab99","created_at":"1970-01-01T00:00:00+


I was quite surprised of all the orphaned files that were there from the past couple of years!

Then restarted HA, and all the orphaned entities are gone.

There is a way I found to purge all unwanted old entries.
Developer Tools->Actions->Action->Choose: Recorder: Purge
Hit “PERFORM ACTION”

1 Like

OMG. I just delete cookie for site saved in browser and unmanaged entities gone!

2 Likes

Works for me too. Thank you!

Recorder: Purge says: “Starts purge task - to clean up old data from your database.”

And as given by clicking the “?” icon the documentation is found at https://www.home-assistant.io/integrations/recorder/

So it seems that Home Assistant uses a SQL database table to keep track of what has happened. sqlite is the default database, but MariaDB, mysql, and PostgreSQL can also be used. (It’s not clear to me if there might be more than one table involved or not.)

BTW, clicking History in the main menu allows you to view data from this database.

And it looks like this Recorder: Purge actually runs some SQL to clean purge records older than a specified age in days from this database table. What data it purges, seems like all data, whatever that is. You can investigate this by using the History menu option to see and download to a *.csv file this data.

If you then load this .csv into a LibreOffice Calc spreadsheet as I did you will find the date/time in a text string formatted in ISO 8601 format which looks like this “2025-03-11T12:57:51.578Z”. To then convert this to a Calc date you can use a formula something like this assuming a given date text string is in C2:

=DATE(LEFT(C3,4),MID(C3,6,2),MID(C3,9,2))+TIME(MID(C3,12,2),MID(C3,15,2),MID(C3,18,2)+MID(C3,21,3)/1000)

Then you can use functions on the new cells like =day() or =year() or hour(), etc. to filter or sort your data.

1 Like

Spook is the answer!