Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot unregister entity (save failed: Entity is already registered) #16524

Closed
watermark opened this issue Sep 9, 2018 · 12 comments
Closed

Cannot unregister entity (save failed: Entity is already registered) #16524

watermark opened this issue Sep 9, 2018 · 12 comments

Comments

@watermark
Copy link

Home Assistant release with the issue:
0.77.3

Operating environment (Hass.io/Docker/Windows/etc.):
Official Docker image

Description of problem:
Trying to rename an entity from "media_player.googlehome1234" to "media_player.basement_speaker" produces the error "save failed: entity is already registered". There did use to be an entity named "media_player.basement_speaker", but it no longer exists on the network. As far as I can tell, the GUI offers no way of removing that old unused entry.

I've confirmed that there is an entry in the .storage/core.entity_registry for the "media_player.basement_speaker"; however, according to the 0.77 changelog, we're not suppose to edit the .storage/core.entity_registry file directly. That makes this issue a bug in my mind. There is no supported way to remove old entries.

In the meantime, despite the warnings, is it safe to shutdown the ha service, remove the entry from the core.entity_registry, and bring it back up?

@mattlward
Copy link

I just changed my WU station to gather data from. This resulted in all of my PWS sensors being appended with _2. I also tried to rename them in the states window and got the same error. How do I clean out the originals so I can rename the new sensors?

Also running 77.3 on RPi2 with Hassio

@ArnoutVerbeken
Copy link

Same here, had to factory reset my Google Home as part of debugging the cast issue (before reading about that issue here), now my Google Home shows up as a new entity and I can't rename it to my old name media_player.google_home_living_room.
Instead it shows up as media_player.google_home_living_room_2.

This of course breaks all automations refering to media_player.google_home_living_room.

I think it should be possible to clean the old entries from the registry.

@bmorgan99
Copy link

bmorgan99 commented Sep 25, 2018

Just tried to reinstall my z-wave devices and I too am getting the "already registered" thing. I factory reset the controller, deleted every z-wave entity in .storage/core.entity_registry and the xml files in /config.

Edit: This finally worked for me. Not sure if all of it is necessary:

Use Remove Node on all your devices in OZW Panel
Shut down Home Assistant
Delete zwcfg*.xml
remove z-wave entity ids in /config/.storage/core.entity_registry
Factory reset Z-Wave stick:
Unplug the Z-Stick from the USB connector and
Press and hold the Reset Button, the LED will become red, then blink faster and faster then stop blinking for 2 seconds then the blue LED will solid for 2 seconds as confirmation. 30 seconds.
Factory reset all devices
  fan switch - 3 taps on, 3 taps off
  smart switch - hold for for 3 seconds while/after plugging in
turn off pi
insert z-wave stick
turn on pi
add devices in OZW panel
heal network

@cgarwood
Copy link
Member

cgarwood commented Nov 5, 2018

You will need to manually edit the .storage/core.entity_registry file to remove the entities. Stop Home Assistant and make a backup of the file before you make changes.

I've been thinking about ways to implement a UI to manage the entity registry, but it may be a while before anything is implemented.

@thepapamaan
Copy link

Just removed an integration due to issues with Google home ghost devices and added it back (Telldus). Now several of my unmodified devices come back as xxxx_2 and I can't edit them back as they already exist. Renaming would be great as well as that HA removes entities completely when unlinked.

@fredrike
Copy link
Contributor

@thepapamaan do as @cgarwood suggests, edit the entity_registry.

@thepapamaan
Copy link

Did that. Still issue. Then I removed the entity and device registry and rebooted. Voila.

@niemyjski
Copy link

This just happened to me with a zwave switch. I'm running Hassio .86.4 and I don't see the entity_registry or .storage folder anywhere.

@altersis
Copy link
Contributor

Hi there, I think that the device registry UI (introduced a couple of months ago) can be of service to you. Just go to Hamburger menu-> configuration-> entity registry, edit the old devices and click on "remove" to get rid of the old entity. Hope this helps for you. If it does, could you please consider updating this ticket and close it? Thanks!

@stale
Copy link

stale bot commented Jul 7, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 7, 2019
@rrubin0
Copy link

rrubin0 commented Jul 7, 2019 via email

@stale stale bot removed the stale label Jul 7, 2019
@DeviousPenguin
Copy link

DeviousPenguin commented Dec 21, 2019

You will need to manually edit the .storage/core.entity_registry file to remove the entities. Stop Home Assistant and make a backup of the file before you make changes.

Thanks for this, I did try editing the file while HA was still running but it was getting overwritten.

Once HA is stopped, edits to the file seem to 'stick'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests