Is there any way to track apple airtags via Home Assistant?

Sounds good. Thanks for the update!

Sorry, I’ve been busy for quite a while :frowning: If you like we could collaborate on this, if you want to create an issue? I think I read something about a FindMy workaround in this thread which might have addressed this, but without further details. I have it running on a spare Macbook where I can have FindMy in the foreground all the time, but I also noticed that updates might stop if Apple thinks FindMy is not being used when in the background…

I also wanted to let all of you know that I released the script on PyPI so you can install it using pip. The released package also has some major updates regarding configuration, some UI changes and, the most important one that I wanted to update for a while, data is now only published if the location timestamp changes, which should drastically improve the performance and reduce some issues. This mainly affected the HA instance but if performance was an issue for you client side, letting the updated script run in the background should not really impact your system anymore.

I’d really appreciate if you could try the new release and see if this reduction in frequency affects the reliability of your home assistant automations etc., or if (as suspected and observed on my devices) meta data is only updated with a new location timestamp.

You can install the script using pip3 install home-assistant-findmy

If you ran a previous verison, I wrote a short migration guide for you (since the configuration changed slightly). Otherwise you can just checkout the README.

I also enabled Discussions so be invited to brainstorm on features you’d like to see implemented or let me know about any issues. I’d really love this to be a project where everyone can provide feedback and assistance to continue a development in the right direction :slight_smile:

3 Likes

Your issue might be related to two things I fixed with the last update (duplicate reporting, updated entity structure). If you want to give it another try or want to check on things together feel free to reach out to me! If it’s not fixed I’d really like to get to the bottom of this.

If you have an existing configuration: Migration guide
If you have no config: Repo

After some extended testing, I also found that AirTags update faster and more reliable now, which can make a big difference in automations :+1:

Thanks @muehlt, I’ve just set up a macOS VM on Proxmox and am using your script.

I set up “Find My” to start on boot as a Login Item:

Then I set up the script to run on boot using a LaunchDaemon plist.

/Library/LaunchDaemons/com.muehlt.home-assistant-findmy.plist:

<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.muehlt.home-assistant-findmy</string>
        <key>Program</key>
        <string>/Users/ndbroadbent/home-assistant-findmy/start.sh</string>
        <key>WorkingDirectory</key>
        <string>/Users/ndbroadbent/home-assistant-findmy</string>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <true/>
    </dict>
</plist>

Then run this command to enable it and start the service: launchctl load -w /Library/LaunchDaemons/com.muehlt.home-assistant-findmy.plist


Here’s my start.sh script:

/Users/ndbroadbent/home-assistant-findmy/start.sh:

#!/bin/bash
set -euo pipefail
cd /Users/ndbroadbent/home-assistant-findmy

export MQTT_CLIENT_USERNAME=***********
export MQTT_CLIENT_PASSWORD="***********"
export MQTT_BROKER_IP=***********
export MQTT_BROKER_PORT=1883
export FINDMY_FILE_SCAN_INTERVAL=5

/Users/ndbroadbent/Library/Python/3.9/bin/findmy -l locations.json

(I couldn’t get the .env file to work for some reason, so I had to export the variables in my script.)

/Users/ndbroadbent/home-assistant-findmy/locations.json:

{
    "home": {
        "latitude": **********,
        "longitude": ***********,
        "tolerance": 70
    }
}

Seems to be working quite well so far!

I followed this guide to get macOS running on Proxmox: Installing macOS 13 Ventura on Proxmox 7.2 – Nicholas Sherlock

It’s a really complicated process and took a bit of trial and error. Hopefully it will keep running for a while without too much maintenance required.

4 Likes

I didn’t see this having been mentioned in the thread, so just wanted to point out that when you’re running “Find My” with the intention of tracking “items” (such as AirTags) the version of “Find My”-app needs to be one that actually supports tracking them.

For example, the version that shipped with MacOS Catalina does not support tracking items (only devices and people) and thus can’t be used … so you can’t simply grab any old old hardware and expect to be able to use that for this purpose since Apple doesn’t allow installing latest versions of the operating system on too old hardware. I have not tried using a version of “Find My” from a newer OS on an older machine - which could work in theory, but I’m afraid that Apple may have limited running the software on older OS-versions … or it may rely on something that is not available on those versions or something.

In retrospect this does make sense, but caused a minor “why isn’t it working at all?” -confusion for me for a while.

Anyone have any idea if the new iOS 17 ability to share Airtags with family could provide easier ways to do this soon?

1 Like

@ndbroadbent I’m trying to get MACOS running on proxmox too and keep getting stuck in the Ventura installer at the 12 mins to go mark… Did you get that problem?

Update: I was fortunately able to test on another server and it made further progress by not stopping at the 12 min mark (all steps followed exactly the same). Turns out that putting the MacOS’s disk onto a NVME drive causes the 12 min mark issue. If anyone is experiencing this problem I suggest trying the install steps on a different Proxmox Server hardware to see if it makes any difference for you.

For anyone’s benefit I followed this guide which despite the robot voice (the author is likely from Vietnam) was very easy to follow and we’ll explained https://youtu.be/iVolaiH-6W8?si=ICbau9w1YbP2Mq8B

1 Like

Hey @muehlt and @ndbroadbent I too have started using the muehlt / home-assistant-findmy script.

I’ve observed that any devices with an apostrophe (i.e. John’s AirTag) does not automatically get added as a device tracker to Home Assistant’s MQTT auto discover. Devices without an apostrophe get added fine (i.e. Johns AirTag). The homeassistant documentation is allowing to manually add the device successfully: MQTT Device Tracker - Home Assistant

Can you confirm if you’re also getting this behaviour and if there’s a manual workaround that does not require renaming device names on the Apple account? (Note: I’m aware that removing apostrophes from the apple name is the easiest solution for me at the moment)

Hi @sebdoan, yes I ran into that issue with single quotes and hash characters, and I opened a PR to fix it: Remove hash from device ID to avoid ValueError: Publish topic cannot contain wildcards. by ndbroadbent · Pull Request #13 · muehlt/home-assistant-findmy · GitHub

It was merged in, so you should run “git pull” to fetch the latest changes and try again

What do you think about this? iCloud3 v3 iDevice Tracker - Version 3 Prerelease version is now available

No. AirTags are not located like an iPhone, iPad or other network type devices. They use low energy Bluetooth to provide location info back to Apple. Apple does not make this available to web base location trackers

1 Like

Unfortunately, life is getting in the way at the moment, so I haven’t had the time to test the new release as much as I liked. But you can use the code on GitHub as @ndbroadbent mentioned, if you like :slight_smile:.

1 Like

With the release of iOS 17 AirTag locations are now shareable to others, is it possible the API set is now available to be able to track in HA?

9 Likes

You can’t just share them with any old account, you have to be sharing them with an email or phone number that is associated with an Apple ID. The recipient must be running 17+ on the iOS device otherwise it will give you an error telling you you cannot share it to them. Your device must also be running 17+ or the option doesn’t even appear.

In theory somebody could host a couple Apple ID emails on a server then build a web application where you can give them a publicly accessible webhook that points to your home assistant server and share your air tags with them. The server would collect the information of the air tags and forward it back to your home assistant server through the webhook. Sounds very doable. You just have to trust them with all of your location data… This would only work when you’re Internet is accessible, no offline support.

1 Like

Oh wow, thank you for making this, i stalled on my own script a while ago, and seeing someone else pick this up and package it properly makes me very happy, good going! :3

That’s a great idea. I would make a donation for it.

I would love to do this but unfortunately not that tech savvy :confused:

Does anyone know of a beginner friendly guide to set up macOS in a VM on my DS423+? Is it even possible?? All I would run on it would be findmysync

1 Like

I would definitely vouch for it! We have 2 Iphones, an Ipad, 2 Apple watches and 4 AirTags for the kids. It would definitely be a quality of life improvement when we could track those devices and of course our kids (when they are away) … 1, 2,5 and 5 years old. We can do that on our phones ofc, but this would be awesome.

I’ve a running Proxmox 4 node CEPH cluster hosting some Unbuntu docker hosts to provide containers including home bridge, I could host an extra MACOS VM maybe, but I rather like/want a more native way.

Cheers
Danny

I think this approach may help :smiley: