Apple AirTag

Hi there Community,

I’m trying to integrate my Apple AirTags (and Chipolo One Spots) into Home Assistant.
Thus far I’ve managed to get my Items.data file from my iPhone and into my HA Config folder. It doesn’t seem that much, but for a sort of noob I think it’s nice work :slight_smile:

I’ve used a spare iPhone 7 (iOS 15.7.4) and applied the Palera1n jailbreak.
Then I had to figure out where the Items.data-file was stored, because this was different from where Airtag Alex found it. On an iPhone 7 running iOS 15.7.4 you’ll find it at ‘/private/var/mobile/Library/Caches/com.apple.findmy.fmipcore/Items.data’.
Now to get that file from the iPhone into HA (the HA Config folder for now). I had to import my SSH-keys into the iPhone, so I opend up my favorite SCP client and downloaded the keys I had generated way back onto the iPhone (var/root/.ssh/) and imported them with “ssh-add {location to key file]”. Then it was some fiddling around with the HA Terminal to get to the right command to download it: scp root@{ipaddress of iphone}:/private/var/mobile/Library/Caches/com.apple.findmy.fmipcore/Items.data /config/includes/FindMy/FindMy.json and next was the awefull method on getting shell_command to run that bloody command; I ended up putting the previous command in a bash-script (located in /config/custom_components/find_my/) and added the following line to my configuration.yaml-file:

shell_command:
find_my: ssh -i /config/ssh/id_rsa -o ‘StrictHostKeyChecking=no’ root@{ipaddress of Home Assistant} ‘/config/custom_components/find_my/find_my.sh’

Now that I’ve got the ability to automate the execution of this command I need to figure out how to get data from a JSON file and preferably put it into one “Device” or “Entity”.

2 Likes

I’ve worked on my script and have released it on GitHub, it’s not perfect but it’s a start :slight_smile:
Any feedback and help is appreciated:

1 Like

thanks for this script, I got this working with some minor changes and now have the device tracker in HA. I did notice though that it seems the “Spare iPhone” needs to be on and in the Find My app for updates to work? If the screen is off or it’s on the home screen it seems the airtag location is not updated and the scp pull retrieves the same stale values from the last known location. As soon as I open the Find My app, I see the location refresh on the app, then then next scp pull it is updated.

Do you keep your iPhone screen “Always On” with the Find My app open or how are you keeping the location updated?

Currently I haven’t got it running. I ran into the same “problem”. I’ve turned off screen locking and had the Find My app open all the time, but after a while the phone crashed and I had to re-Jailbreak it; after several times I was getting tired of re-Jailbreaking.