[Tasker Tips & Tricks] kurokirasama:
Hi everyone:

I've been looking for something like this, and didn't like most of what i found, or it was incomplete. So i decided to start over... and i'm now sharing the result. Its just a high level explanation, since i'm attaching the project. Feel free to give any comments for improvements, bugs or anything. I'm really new to tasker so i don't know if i can help you with odds issues, but i'll give it a try. And sorry for variable names, is a mix of Spanish and English...

[UPDATE:] If you read this before, I'm using variable %CODUR to to calculate call time now. I already updated in below description.

First, you need to define two variables:

-%CicloFac: the day in which your plan restarts.

-%PlanBase: how much you pay per month (in case you are charged extra if you surpass a limit (sms, minutes), like in my case)

Data usage

For data usage, i modified a little what exposed in this post: https://groups.google.com/forum/#!topic/tasker/Pi5bF5zfLUk

At every device boot, recorded data usage is deleted by system, so we need to consider that.

First, define a variable %DataMax, for how much is your data limit (Gb) for each month. Besides, there will be two main variables:

-%DataStored: How much data have i used in the current month before last device boot

-%DataTotal: How much data have i used in the current month (=%DataStored+data since last boot)

Tasks

DataUsage:

Trough java function calls, it gets data usage since boot, add it to %DataStored and saves it to %DataTotal (in bytes).

Besides, convert to Gb (%DataGb) and calculates percentage used (%DataP). Also, it saves %DataTotal variable to a file (DataTotal.txt)

SaveDataStored:

Backup important variables to their corresponding txt file.

ResetDataStored:

It resets all necessary variables (executed every month in the defined day in %CicloFac) for every monitor

DataTotal2DataStored:

It reads info in DataTotal file and assign it to %DataStored (runs at each boot), and from Calltime file to %usedCallsec (for call time)

Profiles

Stored Data On Reboot:

Contexts: Device boot + %DataStored<%DataTotal

Enter Task: DataTotal2DataStored

Save Data On Shutdown:

Contexts: Device shutdown

Enter Task: SaveDataStored

Data Usage:

You can set this as you wish

Contexts: %Mdata~R Si AND %SCREEN!~R on + every 30 min

Enter Task: DataUsage

Here %Mdata is a variable that indicates if i'm connected to mobile data or not. I also have an "screen on and unlocked" profile, that among other things, executes DataUsage if connected to mobile data.

SMS Usage:

You need to define the following variables:

%SMSMax: how many free sms you have in your plan

%smsExtra: how much cost extra sms

Task

SMSCount:

Its add one to variable %smsCount (how much sms have been sent in this month), calculates percentage used and the cost is added to %porPagar if sms free limit is exedeed.

Profile

SMS Count:

Contexts: sms sent

Enter Task: SMSCount

Call Usage:

You need to define the following variables:

%MinMax: how many minutes you have in your plan

%minExtra: how much cost extra minutes

Tasks

CallUsage:

It adds %CODUR (duration of last outgoing call) variable to %usedCallsec (total time of outgoing calls in seconds), then convert it to minutes (%usedMin) and percentage used (%usedMinP). It also displays a flash message with how many minutes you have left or how many minutes you are exedded in your monthly plan. I also add the cost of the call to %porPagar if minute's limit is exedeed.

Profile

Call Usage:

Contexts: outgoing call

Enter Task: wait 0.5 s (for some reason, it dosn't work without enter task for me, maybe you can ignore this)

Exit Call: CallUsage

The profile that resets all necessary variables every month:

Reset Data Stored:

Contexts: day:16th (in my case)

Enter Task: ResetDataStored

And finally, a dummy profile to ensure variable %CODUR get monitored:

Codur:

Contexts: variable %CODUR is set to anything

Enter Task: wait 1 s (or anything)

You can send all variables to, for instance, minimalistic text, and get something like this:

If you can somehow make the widget look more beautiful, fell free to post it here.

You can download the project here:

DataCallSMSUsage Project