Time Tracking With Tasker
I listen to the podcast Cortex when I’m driving, and they got me interesting in looking up time tracking and how maybe this would benefit me. I already use Rescuetime with Exist as a measure of sleep, productivity, social media posts, and other things that correlate to these like the weather, the length of the day, and more. It’s pretty neat and I look at it several times a week.
One metric it misses is driving time. As someone who drove 17,000 miles in the last 12 months for work this is pretty key to me. Apparently rescuetime can do it with an expensive add on, but that only works in the US so that’s no good.
I had a look through the rest of the Exist integrations and nothing really supports what I want. So, I’ve found another way of recording this information directly. Sadly it won’t be with the rest of my Exist data but aTimeLogger generates its own fancy graphs and allows me to export the data to standard formats.
Android Auto –> Tasker –> aTimeLogger #
Basically the flow is as follows. You could also automate this based on connecting to a certain bluetooth radio, or even just an NFC tag you have stuck to your dashboard.
- Plug my phone into my car with Android Auto.
- Tasker notices the change in UI mode
- Tasker sends an intent to aTimeLogger to start timing.
- Disconnect from my car
- Tasker notices the change
- Tasker sends another intent to aTimeLogger to stop timing.
To get this working, add your groupings to aTimeLogger. I added a top level grouping of transportation with train and driving inside this grouping. I guess I’ll add flying to this at some point too.
Once this is done, go into Tasker and create two new tasks. One for when you plug your phone in, and one for when you disconnect. The task below is for when you connect your phone, and is explained line by line:
- A1: Wait for 3 seconds for the connection to stabilise and the radio in the car to sort itself out.
- A2: Using the aTimeLogger plugin in tasker, stop the Driving task if running and start it again.
- A3: Wait another 4 seconds, same reasoning as above.
- A4: Announce over the speakers that tracking is working. This seems to be able to talk over radio just like Google Maps can so is good if you’re not actively listening to Spotify or something.