Monday, June 05, 2017

Location Based Notifications; Or Letting the wife know you're going to be late in the coolest possible way

I still get lots of mileage out of my Report Location Tasker Action I setup nearly 4 years ago. I use it to let Shira know where I'm at when I'm running late on a jog. Sometimes, I put the action in a loop and send her my location every few minutes. At other times, I'll be more selective and use my smartwatch to notify her of my location when I'm at a light or the like.

It occurred to me that I could automate some of this based on my location. That is, when I was getting close to my final destination I could kick off a report so Shira knew I was on my way. Thanks to AutoLocation, which allows you to setup a geofence and then react to it, setting this up in Tasker was a breeze.

I setup the follow three actions: Tripwire Center, Tripwire Arm and Tripwire Trigger:

These three actions form a sort of simple state machine. At the start of my run I kick off Tripwire Center which grabs the current latitude and longitude and updates the specially named geofence Tripwire to be centered around it. It sets this geofence to have a 400 meter radius, or about 1/4 of a mile. Time will tell if this is too large or too small. Finally, the action turns on the Tripwire Arm profile.

Assuming my run is longer than 1/4 of mile, at some point I'll step outside of the geofence. At this point, the Tripwire Arm profile will be triggered and the corresponding action run. This action turns on the Tripwire Trigger profile which awaits my return and also shuts down the Tripwire Arm profile so it's not triggered again.

Finally, as I'm making my way back to my start point I'll eventually cross back into the geofence and the Tripwire Trigger profile will be invoked. This is where the magic happens, as I invoke the Report Location Task here.

I'm going to have log a few runs with this action before I can tell if it's useful. But I'm excited to be putting AutoLocation and geofences to use.

No comments:

Post a Comment