Unifi Integration - help me understand

So in 0.101, the unifi integration added back the bandwidth sensor so I am now trying to add the Unifi integration to my setup.

As soon as I add it, I get nearly 75 entities added to HA a device_tracker and two bandwidth sensors for each device my unifi controller knows about. I know a switch was added to keep the integration from creating a device_tracker entity for every new device it discovered automatically (great!). Why the default is to spam your config with a bunch of entities - I don’t know.

But how do I get rid of the devices it created when I added the integration?

If I go to the integration page, click on an entity, “disable” it, sometimes it removes from the list, sometimes not. Some of them have bandwidth sensors, some do not… There doesn’t appear to be any logic to it.

So, All I want is to be able to add 2 devices from my network with bandwidth sensors. Can someone please help me understand how to make that happen?

2 Likes

I am wondering the same thing hopefully someone will chime and help out. I have disabled all the ones I didn’t want in the UI but some have come back and new ones are being added. I have the check box off in the intergration for creating bandwidth sensors but it doesnt do anything. Is there anything I can add to my config.yaml to hide them?

I asked about this over on the Discord chat. It turns out it’s “by design” that it adds a device tracker for every client your Unifi controller knows about at the time you activate the integration in Home Assistant.

You can set a preference in the integration page to not have it auto-add new devices in the future, but it doesn’t stop it from creating a bunch of device_tracker entities at install.

Therefore, for those of us who only want to track a few devices (e.g., a few phones), you have to install the integration, and then go disable all of the entities you don’t want to see. Then lets say you get a new phone a year from now, the only way to get that phone in is to re-enable the auto-add feature, at which point every client your unifi controller knows about at that time will get added and you’ll have to disable the ones you don’t want again.

It appears the philosophy is “track everything” and who cares how many entities you have in HA. Which I get, but sucks that this is angrily enforced on all users (my suggestion to ask the user at install whether they wanted to add all devices was met with “not going to happen”.

As a side note, if you are going to use the “track everything” philosophy, you need to make sure you either use a proper database or go to whitelist style for the recorder.

3 Likes

I’m likely going to fork the old version and just roll with that as a custom component. I do not need sensors for every device changing as much as they do. Besides, I dont think the data the sensors pull in has proven accurate on the Unifi side for me anyways. I don’t think its right there, so I definitely do not require it in HA. How about a integration parameter to toggle on and off the creation of the sensors.

Anyone know what would be the difference between disabling the entities I don’t want to track (by using the enable slider) and deleting the entities I don’t want to track? Why use one over the other?