core icon indicating copy to clipboard operation
core copied to clipboard

UniFi Network Not Removing Devices

Open databoy2k opened this issue 1 year ago • 5 comments

The problem

Using the UniFi Network Console (self-hosted on network), when I remove old clients I expect the devices to be removed from Home Assistant's list. They are not.

Steps to replicate:

  1. Browse to UniFi Console and click on "Client Devices"
  2. Filter by "All" (rather than "online" so that you see the history of clients)
  3. Delete a client by clicking on it, clicking "Settings", and clicking "Remove"
  4. Restart Home Assistant OR Reload the UniFi Integration - in either case, the device_tracker associated with that device will still be present, and selecting it and clicking "Remove" confirms that the integration is still providing the entity so it cannot be removed.

What version of Home Assistant Core has the issue?

2023.11.03

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

UniFi Network

Link to integration documentation on our website

https://www.home-assistant.io/integrations/unifi/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

databoy2k avatar Nov 24 '23 21:11 databoy2k

Hey there @kane610, mind taking a look at this issue as it has been labeled with an integration (unifi) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of unifi can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign unifi Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


unifi documentation unifi source (message by IssueLinks)

home-assistant[bot] avatar Nov 24 '23 21:11 home-assistant[bot]

As an aside, this feature was a PR back in 2020: https://github.com/home-assistant/core/pull/34307

databoy2k avatar Nov 24 '23 21:11 databoy2k

Additionally, it seems there is also no way to manually remove old devices, even ones that only contain unavailable entities.

mwaterbu avatar Dec 15 '23 02:12 mwaterbu

This has probably been broken down the line of refactoring

Kane610 avatar Dec 16 '23 08:12 Kane610

I have the same issue. Due to another issue with an UniFi Cloudkey an UniFi Flex I got over 5000 random devices in just a couple of hours which coursed my Cloudkey to crash. I solved that issue, but now I'm stuck with over 5000 device_tracker which I can't remove. I tried disabling UniFi Network, but that didn't help. I don't want to delete UniFi Network yet, because of de setup.

Screenshot_20231226_101143_Home Assistant

Screenshot_20231226_101855_Home Assistant

Swerfer avatar Dec 26 '23 09:12 Swerfer

Seems like this was once fixed in #32322

MrAdam avatar Jan 25 '24 07:01 MrAdam

Perhaps consider adding the option to delete devices from the integration hub as available within HA - https://community.home-assistant.io/t/how-can-i-delete-devices-i-dont-want-in-ha/236080/43

Taomyn avatar Feb 08 '24 09:02 Taomyn

Perhaps consider adding the option to delete devices from the integration hub as available within HA - https://community.home-assistant.io/t/how-can-i-delete-devices-i-dont-want-in-ha/236080/43

That's possibly one solution yes

Kane610 avatar Feb 09 '24 23:02 Kane610

@wittypluck has provided functionality to remove devices from the integration. Closing this for now as that was suggested as a way to resolve this issue. Try out the 2024.5 beta which will be out today.

Kane610 avatar Apr 24 '24 17:04 Kane610