Ubiquiti UniFi AP integration: presence detection

Hi, I am using the Ubiquiti UniFi AP integration for presence detection in Home Assistant. I have two access points with IPs 192.168.1.6 and 192.168.1.7 and I have put the below code in my configuration.yaml. Most of the time it works pretty good but from time to time the device_tracker for my iphone does not change state when I leave the house.

Question 1: can anyone confirm that the integration is reliable when it comes to presence detection?
Question 2: how do I include two access points, is my code per below correct in that context?

Integration: https://www.home-assistant.io/integrations/unifi_direct/

device_tracker:
  - platform: unifi_direct
    host: 192.168.1.6
    username: user1
    password: password1
    interval_seconds: 10
    consider_home: 30
  - platform: unifi_direct
    host: 192.168.1.7
    username: user1
    password: password1
    interval_seconds: 10
    consider_home: 30

Thanks!

Ubiquiti holds on to status for way too long to make it reliable for presence. It’s not bad for detecting home, but you can be gone for an hour before it will show you are away.

1 Like

Yes, I noticed that in the Controller interface. Is there a way to change settings in Unifi to make that update more frequent?

With the controller I have no such experience. Within a couple of seconds after a phone enters or leaves the signal it reports that in the controller interface and pretty fast after that in HA too (only tested this with Android devices). I don’t know how that would be any different without a controller and directly via the AP.

Not in unifi. It is a pull contention from HA, so the HA integration should pull the data from the AP more offer if it’s “out of sync” too often.

I’ve never tried directly to an AP, only used it through the cloud key and also the UDM-Pro. I haven’t seen a difference between HA and Hubitat either so it’s not the integration itself. It seems to a common complaint when trying to use Unifi for presence.

It could be. Then I’m in luck I think. Because I never experienced this problem (as well with Hubitat or HA). I use the unifi controller addon by frenck on my nuc. Used a RPi3b+ as unifi controller next to the Hubitat before. Both functioning exactly the same. Could it be because I don’t use 2.4ghz wifi, I only have 5ghz wifi.