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

How to remove entities for proxies that no longer exist #214

Open
bradsjm opened this issue Jun 16, 2024 · 13 comments
Open

How to remove entities for proxies that no longer exist #214

bradsjm opened this issue Jun 16, 2024 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@bradsjm
Copy link

bradsjm commented Jun 16, 2024

Love this solution, much better than anything else I've tried.

I don't seem to be able to delete the entities for previous proxies even if the proxy device itself has been removed.

The "Distance to XXX" and "Unfiltered Distance to XXX" entities can only be hidden for each device. Is there a way to actually remove legacy proxy entities?

@bruvv
Copy link

bruvv commented Jun 28, 2024

this is not a bermuda question but a home assistant question. And here is your answer: https://community.home-assistant.io/t/cannot-delete-entities/620838

@agittins
Copy link
Owner

Hi @bradsjm, apologies for the delay - I have been on another (non-tech) project pretty much full-time for the past two weeks.

I think @bruvv might be right about it being a HA thing, but I wouldn't recommend the process in that link (editing the config entity files) as it's a bit error-prone.

What happens when you try to delete the entities?

Typically you'd see something like this:
image

and clicking on the cog you'd get a dialog like this with the delete option:
image

If you're not seeing something like that perhaps you can post some screenshots of what's going on?

@agittins agittins added the moreinfo More information required to progress further label Jul 3, 2024
@bradsjm
Copy link
Author

bradsjm commented Jul 9, 2024

The delete option is not available for those entities even though the Bluetooth Proxy device no longer exists.

Screenshot 2024-07-09 at 3 29 16 PM

@agittins
Copy link
Owner

Ah ok, so you had a proxy called office_standing_desk, and have since removed it. But the joules_ibeacon device still has an entity for the distance to that proxy.

Bermuda will create (but not enable) an entity for the distance to each known proxy. If Bermuda is still creating that entity it implies that it must still think it has data from that proxy (or it hasn't been restarted since the proxy was removed, but it should still pick up on it even in that case).

I would expect (but have not tested) that if you disable the entity, it should eventually disappear. But then, I'd have also expected it to be able to be deleted, so what do I know! 🤣

I'll do some testing here when I have a chance and see if I can replicate it.

@agittins agittins added bug Something isn't working and removed moreinfo More information required to progress further labels Jul 10, 2024
@agittins agittins self-assigned this Jul 10, 2024
@jleinenbach
Copy link

jleinenbach commented Jul 23, 2024

[deleted as being not helpful and wasting too much space]

@bruvv
Copy link

bruvv commented Jul 23, 2024

for real guys this is not a bermuda issue please see my first post in this issue.

@jleinenbach
Copy link

I get your point, but manually editing the core.entity_registry file is risky and not user-friendly. The code changes I suggested automate the cleanup process, meaning you won't have to touch the registry yourself. This keeps the system tidy without manual intervention, reducing the chance of mistakes. Automating this makes things smoother and prevents issues from creeping in. So even though it's a Home Assistant problem, having these changes in Bermuda can still be pretty helpful.

It's just a suggestion, and @agittins can decide whether to implement it or not. It doesn't need to be a high priority, but it could improve the overall experience.

@agittins
Copy link
Owner

@jleinenbach I'm going to have to insist that you not post any further suggestions from chatGPT or other large language model AIs to this project. By all means use it to help you when creating a PR, but please don't use them to solve a problem and suggest a fix - the result is a heap of info that takes me a long time to assess because it looks legit, but is full of shit.

The generated "solution" does not work how HA works, which is bad enough - but it takes me time to assess whether it's bogus or not, and I can't afford that and it causes me anxiety and frustration. Going forward I am going to take a fairly hard line approach on this because it just sucks my time away and it drains me of motivation and joy.

If you'd like to contribute, I'd suggest having a go at replicating the issue - my previous comment above is pretty clear on the steps to take. If you can replicate it, then do a "download diagnostics" after replicating it, and write up (in your own words, please) your observations. Feel free to offer your (own) conclusions afterwards, but it's really the observations that are key.

@bruvv you might be right but I am not convinced. I suspect that Bermuda is still defining the entity which would cause it to be re-created at startup anyway.

@Menz01
Copy link

Menz01 commented Jul 31, 2024

following this topic as i have this issue as well and would like to get rid of those distance_to"proxies i no longer have"

@jleinenbach
Copy link

As workaround, there is the custom HACS integration "Spook," available here:
https://github.com/frenck/spook

This integration includes a service to remove those entities:
image

Use at your own risk. :-)

@bruvv
Copy link

bruvv commented Aug 1, 2024

Or try this:

Step 1:
Go to the settings page and open "Devices & Services"
image

Step 2:
Click on the service where you want to remove the devices from:
image

Step 3:
For example bermuda, you see an overview of this service:
image
You can now either choice to remove all devices from the bermuda service like so:
image

OR
Step 4:
You want to remove a specific device, you click on the device
image

Step 5:
Click to remove the device
image

This is how you would do this in home assistant with everything. Let me know if you need anything else.

@Menz01
Copy link

Menz01 commented Aug 1, 2024

Or try this:

Step 1: Go to the settings page and open "Devices & Services" image

Step 2: Click on the service where you want to remove the devices from: image

Step 3: For example bermuda, you see an overview of this service: image You can now either choice to remove all devices from the bermuda service like so: image

OR Step 4: You want to remove a specific device, you click on the device image

Step 5: Click to remove the device image

This is how you would do this in home assistant with everything. Let me know if you need anything else.

this method will get rid of the entities you are tracking that you added when clicking the configure button. this will not remove any BT Proxies that you may have configured for testing or ones created by mistake. For example... i tried to add BT Proxy cpabilities to my M5Stack Atom Echo wheile also keeping it as a Voice Assistant. that test failed miserably so i converted them back to Voice Assistants only but the "distance_to_device name" still exists and cannot be deleted using this method

@Menz01
Copy link

Menz01 commented Aug 1, 2024

@bradsjm so i was able to remove all the non-existent BT proxies i no longer had and the "distance_to" entities that were created. and this is what i did:

  1. took screenshots of the devices i still wanted to keep
  2. deleted the bermuda integration from my settings --> devices & services
  3. verified all entities were gone (optional step)
  4. restarted HA
  5. added bermuda integration back to settings --> devices & services
  6. added back the devices i wanted to track

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants