Situation: I wrote an alarm clock app that runs on a MacMini. (No, I have never found any commercial app that works like I want it to.) But sometimes I spend the night away from home, and I don’t always remember to turn the alarm off, which means my poor housemates have to go into my room the next morning to turn off my alarm.
If my alarm app could detect when I wasn’t home, it could programmatically suppress the alarm. That would be sweet. I am looking for suggestions/recommendations for how to do that.
Option 1a: Using the “Find My” network to detect when my iPhone (or the AirTag in my wallet) is not at home. It might be possible to use the OpenHaystack library for this, but I’m a recreational programmer, and deploying that code looks pretty challenging. My skill set is mostly command line scripting, AppleScript, and Ruby. No Objective-C or Swift. (The alarm clock uses the RubyCocoa bridge that Apple has since abandoned.)
Option 1b: Scraping the iCloud web interface might work, if I can figure out how to authenticate against it with code. The login looks like there’s a lot of JavaScript folderol in the way.
Option 2: Detecting the iPhone’s proximity via BlueTooth.
Option 3: Some kind of pressure/weight detector on the bed frame?
Option 4: Something I haven’t thought of yet.
Thanks.