FutureTense / keymaster

Home Assistant integration for managing Z-Wave enabled locks
MIT License
231 stars 43 forks source link

[Feature Request] LockManager uninstall procedure #137

Open Vartkat opened 3 years ago

Vartkat commented 3 years ago

Is your feature request related to a problem? Please describe.

I was using LockManager with ZHA then with OpenZwave and now I'm going to ZWaveJS. As LockManager became KeyMaster I would like to redo things from scratch. Is there any uninstall procedure ? What to delete, how to get rid of all the entities which have been created by LockManager before begining with KeyMaster. And...

Just a word about renaming entities, as some default lock names are very long, putting a suffix as the lock name some times (at least on my screen which is not big) doesn't help, I mean only the first characters are seen on the interface which doesn't help choosing from lock.be469zp_connect_smart_deadbolt_locked_back_door and lock.be469zp_connect_smart_deadbolt_locked_front_door as the interface only shows lock.be469zp_connect_smart_deadbo... Wouldn't it be better to make it a prefix ?

Describe the solution you'd like 1- An LockManager uninstall procedure in the WiKi 2- Prefix instead of suffix in the entities renaming

Describe alternatives you've considered

Additional context I suppose that is because of my small screen as I didn't see anyboby else complain about this naming problem.

firstof9 commented 3 years ago

Prefix instead of suffix in the entities renaming

Renaming isn't required, it's optional and for your sanity.

An LockManager uninstall procedure in the WiKi

This is a good idea, we'll see what we can do.

mifbody commented 3 years ago

I'd like to bump this and add to it -- when I decided to remove Keymaster from my setup I thought it'd be as simple as uninstalling Keymaster from HACS, but it didn't remove any of the entities and there were tons of input Booleans left behind, plus I have a line in my log that seems like keymaster is still lingering somewhere in my system. I can't find any folders/files associated, nor is there anything in my config file. I'm not sure what I need to do to remove this. I'm going to file a separate issue, but just wanted to bump this to stress its importance.

Logger: homeassistant.setup Source: setup.py:172 First occurred: 10:16:25 AM (1 occurrences) Last logged: 10:16:25 AM

Setup failed for keymaster: Integration not found.

raman325 commented 3 years ago

I'd like to bump this and add to it -- when I decided to remove Keymaster from my setup I thought it'd be as simple as uninstalling Keymaster from HACS, but it didn't remove any of the entities and there were tons of input Booleans left behind, plus I have a line in my log that seems like keymaster is still lingering somewhere in my system. I can't find any folders/files associated, nor is there anything in my config file. I'm not sure what I need to do to remove this. I'm going to file a separate issue, but just wanted to bump this to stress its importance.

Logger: homeassistant.setup Source: setup.py:172 First occurred: 10:16:25 AM (1 occurrences) Last logged: 10:16:25 AM

Setup failed for keymaster: Integration not found.

The issue is that you uninstalled the integration from HACS before you removed the integration from your config. Now you still have keymaster in your config and when HA tries to load it, it fails because keymaster the integration isn't installed.

The steps to resolve this are:

  1. Reinstall keymaster
  2. Go into configuration > integrations, find the keymaster card, and click remove/delete from the ... menu
  3. Uninstall keymaster

This isn't specific to keymaster, this is how all integrations work. And when you do step 2 (normally step 1 but you have to reinstall keymaster first in your case), it will clean everything up for you, including files written to disk, except for any lovelace dashboards you have added to your UI because we can't auto clean those up

roborobp commented 2 years ago

So I removed the integrations and uninstalled it through HACS and rebooted. After that, I then removed entities that said Keymaster and the automations related to Keymaster

I rebooted again, reinstalled through HACS, then rebooted again, but I do not see Keymaster in the integrations. Would this be a separate issue or related to the uninstall process?

firstof9 commented 2 years ago

Press F5 in the integrations screen, then try to add it.

roborobp commented 2 years ago

Press F5 in the integrations screen, then try to add it.

That was exactly it, thanks for that!

bmbouter commented 10 months ago

After uninstalling the integration, then removing through HACS and doing several reboots, I am left with a LOT of entities still. How do I remove all of these?

raman325 commented 10 months ago

remove any files related to keymaster in your packages folder, typically config/packages, then reload all automations, input helpers, etc. or just restart HA

bmbouter commented 10 months ago

Thanks for the reply. I've removed the files from /config/packages (the packages dir) and reloaded all the automations, restarted HA, etc, but all of these entities are still around.

I've also tried a lot of other things, reinstalling it in HACS, reinstalling it as an automation, disabling/enabling keymaster of an automation, with lots of restarts in between.

Maybe I'm doing this wrong. Can someone give more detailed instructions? For example I don't see a "reload all automations" button AFAICT.

bmbouter commented 10 months ago

I ended up just resolving it manually by fully uninstalling the add-on, then removing keymaster from HACS, removing everything from the /config/packages/ dir, and then restarting everything. Then I went to /config/entities and ended up manually removing all the entities, helpers, etc associated w/ he keymaster install.

I needed to reinstall with another lock, so I basically then did a fresh install and I was all set.

kingswindsor commented 4 months ago

I have exactly the same problem - having deleted the integration for my lock, then deleting keymaster from HACS, and having done several re-starts, I am still left with loads of keymaster automations. And it seems I cannot delete them because “Only automations in automations.yaml can be deleted” and these aren’t.

Using File Editor I can’t see the /config/entities folder that @bmbouter refers to. Is there anywhere else to look or other ways to tidy this up?

firstof9 commented 4 months ago

Using File Editor I can’t see the /config/entities folder

They were referring to the menus in HA. Check /config/packages, but the integration should nuke all the helpers it created on removal.

mattbruman commented 3 months ago

I have exactly the same problem - having deleted the integration for my lock, then deleting keymaster from HACS, and having done several re-starts, I am still left with loads of keymaster automations. And it seems I cannot delete them because “Only automations in automations.yaml can be deleted” and these aren’t.

Using File Editor I can’t see the /config/entities folder that @bmbouter refers to. Is there anywhere else to look or other ways to tidy this up?

If you are still having trouble with this I solved it for me by adding keymaster back and recreating the locks and name them exactly like they were before. So if you look at your helpers and they are named some like xxxxxxxx.front_door make sure you name them with a space when recreating them. I kept trying with frontdoor and forgot they had a space the first time. Once they are recreated and the files are generated I was able to remove them from the devices & services and all the helpers were deleted.

tlgraf84 commented 2 weeks ago

Same issue for me. I installed Keymaster and set up 4 locks with one of them as the parent of the other three. After removing all four locks from the integrations, then removing Keymaster from HACS I'm letft with about 1,500 unavailable entities. I've even installed Home Assistant Registry in HACS in order to use the ha_registry.remove_entity service. But the task of individually selecting all these entities from the dropdown list seems outrageous... Any help?

tlgraf84 commented 2 weeks ago

Same issue for me. I installed Keymaster and set up 4 locks with one of them as the parent of the other three. After removing all four locks from the integrations, then removing Keymaster from HACS I'm letft with about 1,500 unavailable entities. I've even installed Home Assistant Registry in HACS in order to use the ha_registry.remove_entity service. But the task of individually selecting all these entities from the dropdown list seems outrageous... Any help?

By the way, I followed mattbruman's process above. I re-installed Keymaster, naming the locks just as before. The number of unavailable entities went way down. Clear down to less than 100. But after removing the locks from the integration I was back up to 1,500+ unavailable entities.

kingswindsor commented 2 weeks ago

Same issue for me. I installed Keymaster and set up 4 locks with one of them as the parent of the other three. After removing all four locks from the integrations, then removing Keymaster from HACS I'm letft with about 1,500 unavailable entities. I've even installed Home Assistant Registry in HACS in order to use the ha_registry.remove_entity service. But the task of individually selecting all these entities from the dropdown list seems outrageous... Any help?

By the way, I followed mattbruman's process above. I re-installed Keymaster, naming the locks just as before. The number of unavailable entities went way down. Clear down to less than 100. But after removing the locks from the integration I was back up to 1,500+ unavailable entities.

I’m sorry, no bright ideas from me. I tried the reinstall/deinstall to nuke things but it didn’t work. I ended up just deleting each entity in batches of 50 or so until they were gone, but there were some that I couldn’t get rid of as they had no entity ID (sorry, can’t quite remember the exact error message) so I’ve lived with those.