Unifi Direct device tracking not working

Hello, this is my first forum post, and I’m very novice at home assistant. I’m trying to detect whether mine and my wife’s iPhones are connected to the Ubiquiti Unifi Access Point Lite, and thus infer whether we are home or away.

To test this, I am disabling wi-fi on the phones. However, the device state of both phones is still showing “home” (even after waiting 15+ minutes).

I added the following to my configuration.yaml. Is there some other step I need to take?

I read through this thread Unifi Device_tracker problem
And I’ll admit that’s beyond my understanding, however, it looks like it’s a different issue than what I’m having.

device_tracker:
  - platform: unifi_direct
    host: access_point_ip_address_here
    username: username_here
    password: password_here
    interval_seconds: 15
    consider_home: 180

Not sure if it matters, but for the sake of completeness, my system is:
Raspberry Pi rpi4-64
core-2022.6.7
Home Assistant OS 8.2
supervisor-2022.05.3
Operating System Version 5.15.32-v8

Well somehow I have solved the issue, but I’m not 100% sure how. This is typically how it goes for me with Home Assistant.

It looks like at some point, new device_tracking entities were added with random identifiers. These entities were different from the existing entities for our phones associated with the app.

Now I am able to use these new entities to detect who is home. All is good!

Make sure your phones are set up to NOT randomize its MAC address for your network.

@WallyR, how do I do that?

from the internet

To Disable MAC Randomization on iOS Devices:

Open the Settings on your iPhone, iPad, or iPod, then tap Wi-Fi or WLAN.
Tap the information button next to your network.
Turn off Private Address.
Re-join the network.

Thank you very much! Everything seems to be working, will continue to test this out over the next couple days.

I was trying to use this presence detection so I added recommended code to configuartion.yaml

However nothing happened after restart of Home Assistant, no unify AP integration is showing in system panel and no new tracker is visible in the system.
What could be a problem?
BTW I am using Ubiquity UAP-AC-Lite

# Unifi acces point tracking
device_tracker:
  - platform: unifi_direct
    host: 192.168.1.129
    username: admin
    password: whatever