I have used sosumi to create a php program that gets the info from iFind and puts it into a MQTT feed under owntracks for HA to pickup. This might be useful to find the location / battery of your iphone when you / HA commands instead of relying on owntrack ios app or icloud device tracker. I originally put it into a command line sensor but the 1 minute scan interval kills my iphone battery. I am going to setup how many times it requests through automation based on location / battery level / time of day or request update through Alexa voice command / front end.
There isn’t much to share in terms of programming as I mainly copied and pasted. The formatting for the mqtt message took a bit and I ended up with this using phpMQTT.php. I posted the feed on mqtt to owntracks/my/device
@RobDYI do you have a complete solution on github I can look at? I’ve tried the iOS app (not reliable enough), icloud/icloud2 (polls too often) and wanted to give this a try.
If you get sosumi to work, here is the php script to retrieve iphone location and put it in mqtt as owntrack. You can run this script when you want to update location etc.
run this php script (it works) and it will tell you all your device ids etc
<?php
include("class.sosumi.php");
$iTunesUsername = "uuuuuuu";
$iTunesPassword = "ppppppppppp";
$ssm = new Sosumi($iTunesUsername, $iTunesPassword);
print_r($ssm->devices); // Uncomment this line to view all your device id's
The class.sosumi.php from the tylerhall repo doesn’t return anything, I get errors and it loops forever. The updated class.sosumi.php from the repo above returns the device info. Not sure what’s different (I didn’t diff the two.) When I run the above PHP you provided with the original class file, I get this:
I think the first php script I provided should work as it works for me. I first use
<?php
include("class.sosumi.php");
$iTunesUsername = "uuuuuuu";
$iTunesPassword = "ppppppppppp";
$ssm = new Sosumi($iTunesUsername, $iTunesPassword);
print_r($ssm->devices); // Uncomment this line to view all your device id's
and then I get the device id I want to put into owntrack. I then copy that id to this script.
Thanks Rob - will give this a whirl. I noticed with the iCloud component it can easily put my wife 30+ minutes behind myself (Android/Zanzito) so I plan to schedule a command line automation to run every 15 minutes for update. I assume this is similar to how you’re polling for location on your side?
Yes, I have it when its picked up on nmap component it doesn’t poll, when its charging it polls every 10 mins and when it not_home and not charging, it polls every 30 mins.
Does this still work even if you have 2FA enabled? Looks like the tylerhall/sosumi project has gone five years without an update! I was thinking this might work well as a compansion to bluetooth tracking.