Deleted entities created with old, incorrect ID

I added a new integration from an HACS install, and everything was fine, however I noted that I accidentally gave it a name prefix of “Main Foor” instead of “Main Floor”, and all the entities were using “*.main_foor_…”.

No big deal I thought, just delete the device, it deletes all its entities, and then I add it again. I do that, type in the correct name, but then notice that the entities are all being created still with “*.main_foor…”. When I do the Update Entity IDs option, it only updates a handful of all of the associated entities, and the only way for me to actually fix the others is to change them manually. Likewise, if I am doing a search for the entities, they still show up under the incorrect entity ID, presumably because that is the original name, as shown in the core.entity_registry file.

I’ve deleted the entity and completely restarted HA, as well as checked the various core.* files to ensure that nothing was left over, so I’m confused on WHERE this prior data is being pulled from such that it is still pulling the old, typo’d name, and how I can completely wipe that such that when I add this integration/device again with the correct name, it has NO LINK whatsoever to the old typo name.

And Did you forget to Restart HA,( the first time ) after you performed such action, where you wanted make the best effort to remove “traces” ?

Could be your DB + log-entries

PS: Also You didn’t mentioned which integration, but most integrations have own “settings/logs” and sometimes there could be “left-overs” in the /Custom_Component which you have to remove manually ( Specially, if you didn’t Restarted the first time )

1 Like

And Did you forget to Restart HA,( the first time ) after you performed such action, where you wanted make the best effort to remove “traces” ?

Negative. I had the same thought, and to ensure I had not forgotten such, I went through the same process again: delete the device, delete the integration from HACS, restart home assistant, install the integration from HACS again, restart home assistant, add the device, see it automatically pick up the name of “Main Foor” and the entities have the same. I also tried repeating the process from an incognito window, just to be sure there wasn’t something related to the browser cache going on here. Likewise, with manually deleting the data from the various files in the .storage folder, I also shut off HA before editing the files, and then started it back up afterwards to ensure it was not a scenario of data being written to disk on shutdown.

Could be your DB + log-entries

I loaded up the sqlite db and browsed around it. Nothing in there stands out to me as a “we will be pulling old entity data from this table.” Statistics, states, events, none of which seem to apply here and nothing from the tables I saw that seemed like it would have been a source of information. I also cat’d the home-assistant.log and saw nothing matching either.

PS: Also You didn’t mentioned which integration, but most integrations have own “settings/logs” and sometimes there could be “left-overs” in the /Custom_Component which you have to remove manually ( Specially, if you didn’t Restarted the first time )

It’s the Lennox S30 integration. I’m attempting to integrate my two HVAC systems in with HA. I already looked through the /Custom_Component folder and noted no such left over kruft.

Did you check the Custom_Component folder also, normally when i fu, i Reboot, not Restart, after i’ve “tried” to ensure “cleaned up/changed-reverted”

Ok, sorry i was “busy” writing :slight_smile:

1 Like

Did you check the Custom_Component folder also, normally when i fu, i Reboot, not Restart, after i’ve “tried” to ensure “cleaned up/changed-reverted”

Yes. I noted in the last paragraph of the first response since I saw your update come through, but I checked the /Custom_Component folder. As is now, the integration folder does not exist on the file system at all since I uninstalled it. Likewise, I tried both the restarting and the rebooting (it’s within a docker container, so simply restarting the container in this case for a “reboot”, but same process)

1 Like

OK, im out then :slight_smile: , i have no experience nor knowledge of HA in Container, other than i know HAOS, also uses containers, for it self and Add-Ons

Last thing i can think of is at /Settings/Devices-Services click the “entities” make sure you don’t have any “filters” on, search for file-names there, if there are “old/disabled” entities there

PS: I just sweeped the integration, and 1 place mentioned you should reboot the thermostat , not sure if that’s because the Thermostats “store” info, like name

1 Like

OK, im out then :slight_smile: , i have no experience nor knowledge of HA in Container, other than i know HAOS, also uses containers, for it self and Add-Ons

I appreciate the help. In this case, it running in a container is no different than it running in a VM or on a dedicated machine, with the difference that for the data folders, I am mounting a folder from the host machine into the container, such that when it reads from / writes to disk, it is technically doing so from the disk of the host. Everything else is ephemeral to the life of the container.

Last thing i can think of is at /Settings/Devices-Services click the “entities” make sure you don’t have any “filters” on, search for file-names there, if there are “old/disabled” entities there

I checked there as well, nothing for “Foor”, and no filter. Thanks for trying to help out!

1 Like

Dunno if you saw i added this, And i also saw something about a Hub, so depending upon which Devices you have, maybe it’s good, as mentioned there, shut down HA, reboot/reset your thermostat and i.e hub

1 Like

Entity_ids (and other user settings) are now retained even if you delete the integration, device, or entity. Just rename the device and regenerate the entity_ids from the 3 dot menu on the device.

2 Likes

Entity_ids (and other user settings) are now retained even if you delete the integration, device, or entity. Just rename the device and regenerate the entity_ids from the 3 dot menu on the device.

This does not work. I noted in my original post, but out of approximately 30 entities, it says it will only be updating the entity_ids for a handful of them. All the others retain the original, incorrect entity_id, unless I manually rename it, at which point it still has references to the old, incorrect entity_id and name within the core.entity_registry.

1 Like

Now you said it i do recall i had/tried to do that one occasion, shifting to the new TP-Link integration :smiling_face:

1 Like

I believe that was also my first and only experience with that feature, and why and when they decided to “retain” things one ones to get rid of, i have no idea :slight_smile:

1 Like

Are you running an old version of HA? The current versions will alter all entity_ids without skipping any when you regenerate entity_id’s from the 3 dot menu.

1 Like

Are you running an old version of HA?

Negative

The current versions will alter all entity_ids without skipping any when you regenerate entity_id’s from the 3 dot menu.

Negative.



name it back to Main Foor WT ENV, regenerate the entity_ids, then rename it Main Floor and generate again.

1 Like

name it back to Main Foor WT ENV

It was never actually named this, so I assume you are saying to name it to this, which does not seem to be a viable alternative solution. The _wt_env entities had that suffix by default, this would be adding the _wt_env suffix to the other entities, and then removing it from all entities, if I understand what would happen correctly.

To clarify, the system is simple and you can abuse it. All it does is look for common slugified device names and replaces those values. So those others weren’t changed because they didn’t have main_floor and they didn’t change originally because they had main_foor_wt_env

1 Like

Interestingly, now it is holding on to the old Main Foor WT ENV name if I recreate the device instead of the Main Foor name, but still won’t hold on to Main Floor :melting_face:

well I see some main_floor_wts in there for those old _wt entities. What’s the exact process you followed?

1 Like

Renamed to Main Foor WT ENV, did the regenerate entity ids (but did not confirm), canceled out, deleted the device, restarted HA, added the device again, saw that it now was being given a default name of Main Foor WT ENV instead of Main Foor, clicked the regenerate entity ids, got the above popup. I had at one point manually renamed all the main_foor_wt_env_* entities to main_floor_wt_env_*, but noted that the old main_foor_wt_env_* name was still present in the core.entity_registry file, so deleted everything to try and figure out how to get it creating everything “properly” instead of me having to juggle entity ids.