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.

Снимок экрана 2022-01-18 в 15 58 03

Снимок экрана 2022-01-18 в 15 58 30

Снимок экрана 2022-01-18 в 15 58 12

  • 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.

Снимок экрана 2022-01-19 в 16 02 57

Снимок экрана 2022-01-18 в 15 58 34

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:

  1. Devices, connected to the Unifi wi-fi network which is not included into the integration settings filter, should not appear in HA.
  2. 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)

Most upvoted comments

Exactly. You will approve what clients entities should be created for.

This is just a formulation right because its an inclusive filter "ssid_filter": "Select SSIDs to track wireless clients on",

I see a lot of similar entities like these: Снимок экрана 2022-02-15 в 21 18 49

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: Снимок экрана 2022-02-15 в 21 19 30

Expected behaviour: 1) add ability to remove ‘orphaned’ Unifi entities, 2) add to integration filter to show only ‘Configures’ clients: Снимок экрана 2022-02-15 в 21 28 15