Originally posted on Reddit.
This task / widget combo displays two values on the home screen of both my and my wife’s phones. The distance between us and the number of hours since the other person last updated their GPS location.
I travel for work sometimes. Before my last trip, I started learning about Tasker and became inspired to slap this together.
All testing and implementation was done with the PRO version of any apps below. I don’t know what capabilities are lost on the free versions. Sorry!
- Tasker – Brains for the operation.
- Zooper Widget Pro – Awesome widget creation app with Tasker integration
- Spreadsheet Tasker Plugin – Tasker plugin that makes Google Sheets querying and updating super easy. Made by UITCON out of Denmark.
- Google Sheets – SAMPLE SHEET Our information will be stored in a spreadsheet with two separate sheets in it.
Task is triggered by a Time profile or by tapping the widget on my home screen
- Get Location – 1 – Tasker polls the phone for its currently coordinates and updates %LOC
- Spreadsheet Update – 1, 2 – Add a row to my sheet of the spreadsheet with date, time, my current location, and the current time again, in epoch format (makes calculation easy later)
- Spreadsheet Query – 1, 2 – Grab the last row of data from my wife’s sheet and assign to variables based on column titles
- Variable Set, %OLOC – 1 – Set a global variable %OLOC to my wife’s last coordinates
- Variable Set, %HOURSSINCE – 1 – Calculate the number of seconds between “now” and my wife’s last update then convert to hours
- Zooper Widget Pro Variable, distFromOther – 1 – Make available the calculated distance to a Zooper variable
- Zooper Widget Pro Variable, hoursSince – 1 – Make available the calculated hours since last update to a Zooper variable
- Create / Edit a Zooper widget (“quick” YouTube guide!)
- Include the variables #TdistFromOther# and #ThoursSince# one or more “Text” widget modules
- Zooper refreshes the widget based on a configurable interval
- During refresh, Zooper queries Tasker for the values belonging in #TdistFromOther# and #THoursSince# and Tasker responds with the values currently populating %DTO and %HOURSSINCE
Your Zooper widget should now be displaying the data from Tasker!