Android update breaks my wifi-based device tracker because MAC address changed

I have a OnePlus 6T phone, and just did a major upgrade to the lastest Android, version 10. And I noticed that my Wi-Fi based device tracker stopped working and didn’t show me at “home”. My device tracker relies on detection of the phone’s MAC address being associated to a Wi-Fi access point in my home.

It turns out that the MAC address of the phone changed after the update. Android 10 has an ability to randomize the MAC address as a tool to prevent tracking. Perhaps Android 9 did as well, and it chose some other randomly selected MAC address that it it continued to use on my home WiFi network. In Android 10, it looks like maybe I can set this behavior on or off by wifi network, but I’m not really sure… In any event, I turned it off and updated the address being tracked.

Perhaps this experience might save someone else some time.

1 Like

Yeah you can set it to use the device’s actual mac for your WiFi network. That’s what I’ve done.

Although I’m now having trouble because I use monitor.sh for Bluetooth tracking and it doesn’t seem to work anymore and I can’t find a setting to prevent randomisation for Bluetooth macs. Ignore that - worked that one out and it was my fault using dashes instead of colons when I sent the new mac address to the known_static_addresses file.

1 Like

I’ve noticed that Android 10 breaks my AP too. It reserves a lease for every device (probably based on the MAC address). Now I have suddenly thousands of leases on my router which aren’t even connected and the router reports that it’s currently full.

Well…

Settings > Network and Internet > WiFi > your network > Privacy > Use device MAC

Yes, that would solve it, but as more and more devices use that random MAC thingy, it really becomes a problem. I can’t tell every single guest to change settings on their phone - I mean, I can, but it’s extremely annoying.

Changing the lease time to 1h probably just “stresses” the router and makes other devices wake up more, causing more battery drain on phones (even if marginally) and maybe even connection issues.

I personally find it a dumb decision. Yeah, “privacy”, but isn’t there a better way? Maybe changing the MAC once a week or so? That way it wouldn’t interfere with lease times.

This is one of the reasons why I abandoned using the UniFi integration in Home Assistant. It seems to solve a bunch of network management problems that I didn’t have, and the one problem that I did have, it solves badly by default. I only really care about the presence of two MAC addresses, and I don’t need to clutter up Home Assistant will all these other entities. You might be able to disable it adding more entities in by default, I’m not sure.

I just adapted a python script that I found to ping against the UniFi API to get the list of associated clients. It looks for only the devices I care about, and then publishes some state with MQTT. And I have a couple of MQTT device trackers in Home Assistant that look for those MQTT messages.

See https://github.com/lmamakos/unifi2mqtt for the hack that I’m using, if you’re curious. It looks for the device MAC address or by the device name that UniFi knows.