core: Unifi integration works incorrectly with filters
The problem
I use Unifi integration in order to manage net devices, connected to unifi router and APs. I have several wi-fi networks and use network filter in the integration settings. But nevertheless I face the next issue on regular basis:
- In case when new network device appears in the wi-fi network, that excluded in the integration settings, this device appears as device_tracker in HA and doesn’t disappear unless you remove/add Unifi integration again.



- Moreover, you can’t remove some of these device_trackers via HA Configuration/Entities tool - nothing happens if you try to do it. Some of such devices have empty device card.


As a result, I have 150+ devices/entities in HA while there are only about 10 devices in the selected filtered Unifi network.
Expected behaviour:
- Devices, connected to the Unifi wi-fi network which is not included into the integration settings filter, should not appear in HA.
- It should not be any devices of the Unifi integration without device_tracker sensor.
What version of Home Assistant Core has the issue?
core-2021.12.4
What was the last working version of Home Assistant Core?
None
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Unifi
Link to integration documentation on our website
https://www.home-assistant.io/integrations/unifi/
Example YAML snippet
GUI settings of the integration
Anything in the logs that might be useful for us?
No response
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 131 (31 by maintainers)
Exactly. You will approve what clients entities should be created for.
I see a lot of similar entities like these:
I know that initial reason is the bug of Unifi Controller that sometimes add such “hosts” to Unifi Clients, but the bug of the integration that that items can’t be removed from HA and they don’t disappear from HA by themselves. You can see on the screen above that I can select these items, but ‘delete’ button doesn’t delete them. Here is how the entity card looks like:
Expected behaviour: 1) add ability to remove ‘orphaned’ Unifi entities, 2) add to integration filter to show only ‘Configures’ clients: