Monthly Archives: February 2018

Time Tracking with Tasker (Driving & Sleep Time)

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.

Screenshot of aTimeLogger

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.

  1. Plug my phone into my car with Android Auto.
  2. Tasker notices the change in UI mode
  3. Tasker sends an intent to aTimeLogger to start timing.
  4. Disconnect from my car
  5. Tasker notices the change
  6. 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.
Start Tracking Driving (2)
	A1: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ] 
	A2: aTimeLogger [ Configuration:Stop running and start Driving Timeout (Seconds):0 ] 
	A3: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ] 
	A4: Say [ Text:I'm tracking your driving now Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] 

The stop driving task is pretty much the same, but A2 is reversed so it’s Stop driving. Pretty simple. Make sure you actually save your changes as I managed to close them without saving.

Now you need to create some profiles that trigger based on Android Auto being active or not. The best way I found to do this was checking the variable %UIMODE and seeing if it was set to ‘car’ or not. This is set by Android Auto so its a good indicator as to whether I am in the car or not! Maybe there’s a better way but this works for me.  Let me know in the comments?

Screenshot_20180212-140517

Profile: Car Active (7)
	State: Variable Value  [ %UIMODE ~ car ]
Profile: Car Not Active (8)
	State: Variable Value  [ %UIMODE neq car ]

Both of these profiles are then linked to the above tasks which we previously set up. Now next time you connect your phone to Android Auto it should start time tracking in aTimeLogger and announce over your speakers that it’s doing so. As soon as you disconnect (I have to turn the ignition off, and open the drivers door before the phone fully disconnects) it will stop and save that time log. You shouldn’t have to do anything further! Enjoy the data.

You might have noticed in some of the screenshots that I am also doing something similar with sleep tracking. To do this, I am using SleepAsAndroid alarm clock with its Android Wear add-on to actually track my sleep.

Tasker is listening for the intents from SleepAsAndroid and starting the timer in aTimeLogger then stopping it for me in the morning when I stop my alarm.

Advertisements

What I’ve been playing – Level 2

It’s been a while since my last blog post… I’ve been busy with work, the gym… and… playing lots of games! Here’s a run down of that last activity.

November 2017

After telling myself I wouldn’t be buying Skyrim for the second third time, I bought Skyrim for the third time. I’ve spent the most time in the game this time, but I still got bored of the main quest. Pretty sure I finished the Dark Brotherhood questline, starting being a thieving shit in the Thieves Guild and generally romped my way across the world.

Playing Skyrim on a portable is really neat, and probably the reason I managed to put so much time into it. I will go back and finish the main quest line at least, but for now I’m done with Skyrim again. I’m hoping for a Fallout port in the future so I can buy those again and play on the go. Please, Bethesda.

I was deep into Stardew Valley too which continued into December. I’ve spent more time in Stardew Valley (60 hours) than any other Switch game in the last 11 months.

Stardew is just the perfect zone out game after a long day. It’s super duper easy to get sucked into ‘one more day’ too. For now I’ve stopped playing Stardew until the multiplayer is released later this year so I’m not entirely burned on the game.

Not that kind of multiplayer….

Rounding out the top three for November was Super Mario Odyssey. I can’t really say much that others haven’t. It’s such a good game and I need to go back and do it justice at some point. I got to the credits (not hard in any modern Mario) and haven’t been back since. I might actually start a new save when I go back.

Top 3 Switch Games in November

December 2017

I think there was a Splatfest that I played in… I only really play Splatoon during Splatfests…. Nothing much else to say about December except that I got Mario + Rabbids for Christmas.

Top 3 Switch Games in December

January 2018

Golf Story! Golf Story! Golf Story! What a great game!If you own a Nintendo Switch, and don’t have Golf Story… what is wrong with you? It’s an awesome mix of classic RPG with memorable dialogue mashed together with a decent golf game.

Did I mention it has frisbee disc golf, and mini golf alongside the normal golf you’d expect. I got about 15 hours of playtime out of it, and still CANNOT beat the last tournament. Holy crap, that was a difficulty spike and a half.

Golf Story has some great writing

Top 3 Switch Games in January

What I am playing now

I’m currently stuck into Mario + Rabbids battle kingdom which is seriously catering to my addiction to turn based strategy games.

I think I am about a third of the way through so this will probably take up most of my February. Maybe I’ll get into Farming Simulator next… I have a lot to choose from anyways…