Tracking My Dog With Apple AirTags and ESP32 Using MQTT or ESPHome

TLDR: Is there a way to track AirTags with ESP32 sensors using MQTT or ESPHome?

Full Story: I’ve got a puppy that isn’t housebroken yet and I came up with an idea of attaching an AirTag to her collar and wrote an automation that will alert me using my echo dots that my dog is near the back door, which will prompt me to take her out. I’m using an ESP32 as the bluetooth sensor and have it feeding data to Home Assistant using MQTT.

At first it worked, but after only a few minutes had passed the Device ID changed, which broke the automation. After this happened several times I realized this must be a security measure put in place by Apple that will randomly generate a new Device ID at some predetermined time interval.

I started searching this forum and saw similar topics, but not exactly the same as what I’m trying to do. I found a post that went into detail about how to feed HA the needed information using a script run on a Mac, but that would require me to setup a macOS VM, which I don’t think is very easy to get working if I’m not mistaken. However, this is beside the point because Apple’s FindMy service isn’t precise enough for me to be able to make a differentiation between my dog being by the back door and just being home in general.

I’m not married to using MQTT or even AirTags if there’s a better way, I’m totally open to suggestions.

Thanks in advance!

Apple devices have an IRK (Identity Resolving Key) which is more reliable than the standard device ID. I’m not sure if AirTags use them though. I’ve got some standard BT tags on our dogs’ collars and am using them with ESPresence around the house. I’d say that method is around 80% reliable for us. It’s been a real pain trying to fine tune the absorption and distance settings to get that level of reliabiity.

This site here appears to walk you through using the Apple IRK to track devices. See if it works for you:

I would just voice my concern if the puppy ever got that tag off and chewed it. The cell inside it would do a lot of harm to a dog if it swallowed it.

He tracks his dog and even has a solution to keeping dog from eating the device.

Thank you all for the replies! I’ve got stuff to try now :slight_smile: