iCloud device_tracking interferes with router device_tracking of iPhones

I’ve been using the Ubiquiti UniFi integration for device tracking. I have some integrations that make use of the “ap_mac” attribute so I can identify which WiFi access point a person’s phone is connected to. I use this to identify when someone is outside or in the shop.

I recently added the Apple iCloud integration to get the device senors for some of the family’s phones. However, it seems that the device_tracker entries are de-duplicated based on MAC address maybe? All of my previous unifi router based trackers stopped updating and I no longer get the ap_mac attribute from the Apple version of the device_tracker.

Is there some way to use both and have duplicate device_tracker entities for each iphone? Or do I need to give up on the Apple iPhone integration and uninstall it?

OK, so it seems that sometime in the last few weeks that the router based device_tracker.randomstrings_iphone got ghosted, device_tracker.randomstrings_iphone_2 was created by the Apple iCloud integration and worked as advertized (but doesn’t support ap_mac like the router inetegration does), and a new device_tracker.unifi_ca_ce_70_31_aa_f0_default that corresponds to my iPhone got created. Thankfully the ap_mac attribute is included and updated.

What triggered the change? Could it be the latest iOS update with enhanced privacy is no longer reporting the friendly nane to the router? Checking my unifi host, it still knows the name of my phone. What integration decieded to rename the device_tracker entity for my phone? why leave the old device_tracker entity around and silently stop updating it? why create a new device_tracker name based on the MAC address and not create randomstrings_iphone_3?

This would be my WTH contribution, if that wasn’t closed now.

One more WTH to add. Of of my four family members with iphones, the above behavior effected 3 of the iPhone device_tracker entities. The forth did the sane thing and uses the friendly name device_tracker.joes_iphone (no _2 no unify_MAC_ADDR_default) and just kept on working.