Presence with iOS private address

Now that nearly all the modern iPhones (and their users!) are configured for ‘Private Wi-Fi Address’ and so change their MAC, what is the new strategy for detecting Presence with Home Assistant?
Any ideas?
Getting all users to turn off the Private Wi-Fi feature is not practical (and I don’t want to do it either) so what is new way to detect presence?
My current wifi solution is using the Ubiquiti Integration, and until this latest iOS feature it worked really well!
Ideas?

I’m using Bluetooth instead. The drawback there is distance. My apartment is small enough that I can cover the whole place with one RPi running a custom written python service to report device presence back to HA, but in a larger place you’d need more than one of those. All the code for the tracker is on GitHub if anyone is interested:

Does this assume BLE MAC address stays constant?
I thought Apple were randomising BLE MAC as well?

This can be done by monitor. The link has an explanation of how it works with iPhones etc.

It looks like only the low power Bluetooth does randomization, at least if I’m reading this correctly:

I believe the script I wrote is using Bluetooth Classic, which doesn’t appear to change the MAC. The bad news is it means more power drain on the device, but so far even when I turn bluetooth off and back on the MAC I’m using doesn’t change, and because I’m only checking every 5 minutes it doesn’t seem to be that big a deal. I may look at Monitor some more and see what it’s doing.

I was looking at the WiFi randomization some more, and it looks like iOS creates a new MAC for each WiFi network, not a new MAC every time. So, in theory, once your iOS device connects to your WiFi, its MAC shouldn’t change unless you forget the network and join again.

Thanks @michaelblight and @pkscout you have given me plenty to look at.
I will go away and do some more playing myself now.
Cheers
Paul

Re-starting this thread as I still haven’t found a solution to this!
The kids have come home for a visit and because of address randomisation HA is not picking up their phones for presence.
Any other ideas?
Surely this is a common requirement?

[SOLVED The MAC address randomisation can be turned off per SSID. For the home network, everyone just turns off randomisation - easy]

If I am not mistaken (which I may be) the mac address doesn’t change each time someone connects. A new mac address is assigned though for each SSID. So unless they reset or erase settings the virtual mac address will remain the same. Also as ha_bob mentioned you can turn off Private Wi-fi on just your home network.

I hope it is okay to reopen this thread instead of starting a new one.

I don’t think relying on users to keep the mac randomization off is realistic (at least in my case).

Is there a currently advised way to detect presence using network connectivity?

Thanks!

You can toggle “Private Wi-Fi Address” per network, so they only need to turn it off for the home wifi.

100% right. Its not an issue at all for all my family to turn off privacy for the SSID “home” and don’t touch any other networks. The fact that it is for a single SSID is the game changer to make it work for me

1 Like