OK, here's how I geeked out this weekend. Had an <emoji lightbulb> idea to hack up a virtual IN/OUT board for my home...
Premise: Get alert when someone gets home or leaves by detecting their cell phone is/isn't connect to house wifi router. ‎· Micah
1. Engage my top operative, agent Raspberry Pi (loyal, and works for cheap). ‎· Micah
2. Run a python script that scrapes the DSL modem/router web interface home page (in my case, an Actiontec) which conveniently shows a list of devices currently connected. Turns out the HTML is built dynamically on client from a javascript variable. Scoop up the variable statement with regex and split apart the logical components. ‎· Micah
3. It looks like this: ‎· Micah
4. var hostinfo = 'WowzerTV/|FoobarPhone/| Bazs-iPad/'; ‎· Micah
5. Split string first by pipe character (the devices), then by slash (the values of each device). ‎· Micah
6. The last value is a '0' or '1'. 1 means it's connected. 0 means it's NOT connected (but was in the past, that's why it's in the devices list at all). ‎· Micah
7. Identify each person's cell/tablet device name (you could use the mac address, alternatively). ‎· Micah
8. Set a python dictionary with {"name": "Grampa Joe", "device_name":"JDawgs-iPad"}. Loop through and compare to data extracted from the hostinfo javascript. ‎· Micah
9. Store the In/Out state for each person/device and if it changes (run every N minutes) send an email alert or use a notification service/API (I've been experimenting with PushOver - https://pushover.net - simple and I like it pretty well already). ‎· Micah
10. Das it. ‎· Micah
11. Of course there are other less hacky ways to do this, like running a feature-full firewall with rule/alerts built in. But I wanted to use some of the resources already in play on my home network. ‎· Micah
TL;DR .... too bad, really. ‎· Micah
Did you hear the npr thing about a guy who rigged up a Weasley family clock using phone gps tracking? I can look it up if you're interested ‎· Christina Pikas
^ I was just going to post that too ;-) ‎· heleninstitches
Huh, cool. Thanks Christina and Helen. I hadn't bumped into this before and I search for DIY projects, especially all things raspberry pi, all the time. Found the Instructable—nice. Utilizes Spark Core ( branded Particle or whatever now ), clients publishing GPS location is gives me new thoughts to chew on. ‎· Micah