dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
734
michio
join:2002-06-19
Canada

michio

Member

[INTERNET] Tasker Usage Project

Hey everyone,
Not sure if anyone here uses Tasker but I thought I'd share my project anyway.
If you don't know what Tasker is its an Android app used for automation. (»play.google.com/store/ap ··· .taskerm)

I've never exported a Tasker project before so forgive me if it doesn't work.
Basically it has three profiles.
1) API Key
For getting your API Key
Trigged when %APIKEY is NOT set and connected to WIFI
This one needs to be run when you are connected to your home WIFI to grab the API Key for you.
2) Get Next Month
Triggered when %REMAINING is less than 0 (i.e next month has rolled over)
For getting information on the next month used for calculating estimated usage. This one is sort of cobbled together since there doesn't seem to be a good way to find the last day of a certain month. Basically it just grabs the current month and adds one. If the current month is 12 it adds one to the year and sets the month to 1. Then it converts this date into seconds and does some maths to figure out how long the month is in seconds.
3) Usage Checker
Triggered once an hour between 9am to 2am and when %APIKEY IS set and not in airplane mode.
This is the actual checker. It first calculates the current date in seconds and figures out how much time is remaining in the month. Then it httpgets from start.ca using the apikey and pulls in the downloaded totals. From there it does some maths to calculate usage in gb and the estimated usage (I calculated it as Used*Total seconds on the month/Seconds passed this month). Then it dumps it to a variable for minimalistic text (»play.google.com/store/ap ··· imaltext) so you can create a widget with variables (%STARTDOWNLOAD and %ESTIMATE). If you don't use minimalistic text you can just delete those tasks and use the variables however you like.

Hopefully you can get some use out of it.
As far as I know it works

rocca
Start.ca
Premium Member
join:2008-11-16
London, ON

rocca

Premium Member

Excellent, thanks for your contributions!