If you're not using an unlimited minutes/data plan, then you might be finding yourself monitoring your usage so you can stop yourself from incurring significant overages on your account. You can use a third-party widget or get notified from your carrier's app (if such a feature exists) but the disadvantages of these are a) the theming abilities of these widgets are limited or b) your carrier's app isn't all that great.
Using Tasker, AutoInput, and USSD codes you can easily grab this data and manipulate it however you want. In my tutorial, I will be grabbing the minutes/data used from T-Mobile USA and incorporate it into a Zooper Widget.
Prerequisites
AutoInput to query the text on the toast input.
USSD codes you can run that will provide you with the remaining minutes/data left in your account. You will have to look these up for your carrier.
OPTIONAL: Zooper Widget, for displaying the minutes/data in the form of a progress bar.
I'm not defining any contexts here for you, but you can set these tasks up to run on whatever trigger you want. For instance, for me I have these two tasks run every night at 1am to update my Zooper Widgets.
Instructions
Run the USSD code you want to automatically grab at least one time manually in the phone app. Take a screenshot or write down the text used for reference. It's less than 160 chars since it's an SMS, so don't complain about having to write (You could use Flash action to show what the output is, that's up to you though)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Create a task and call it "Call Usage."
Phone --> Call. Set the Number to the USSD code that will return how many minutes you have left. For me on T-Mobile USA this is #646#. Check "Auto Dial."
Plugin --> AutoInput UI Query. Check "Only Visible" and go down to "Text" and put in some unique, recurring text from the USSD code pop-up that AutoInput will wait to see before querying the screen. For me, I used "Addl minutes are charged" because I'm on a pre-paid plan.
Plugin --> AutoInput Action. This one is a bit wonky to set up, but basically you'll want to have AutoInput ready to record your tap input while the USSD is already on screen. To do this I would recommend setting a wait function before running the USSD code, then quickly going to AutoInput and starting the record input function. Once the USSD code is on screen, you can record the input. Optionally, you can use an input tap to have it tap anywhere on the screen to dismiss it.
Variables --> Variable Split. Split %aitext(1) in an attempt to isolate the amount of remaining minutes you have. For me, I set the Splitter to "You have"
Variables --> Variable Split. Split %aitext12 to fully isolate the number value of the remaining minutes. Here, I did "included minutes" as the Splitter.
Variables --> Variable Set. Set Name to %calltotal and set it To your total minutes minur %aitext121. Check "Do Math". This will determine how many minutes you have actually used.
(OPTIONAL): Plugin --> Zooper Widget Pro Variable. Set #TCALLUSAGE# (which should be written as CALLUSAGE within the ZW configuration, but is presented to ZW as variable #TCALLUSAGE#) to %calltotal. Now you can display this variable as a part of any Zooper Widget you like!
Create a new task called "Data Usage."
Phone --> Call. Number is the USSD code that tells you the data remaining in your plan. For me on T-Mobile USA it's #932#. Again, set it to "Auto Dial."
Plugin --> AutoInput UI Query. Again, like before, click on "Only Visible" and for Text set something unique from the USSD code pop-up that will make AutoInput query the screen when the text pops up.
Plugin --> AutoInput Action. Do the same as before, hell, you can even copy/paste the same action from the previous task to dismiss the pop-up!
Variables --> Variable Split. Split %aitext(1) to isolate the amount of data used. For me, I put "You have used" as the splitter.
Variables --> Variable Split. Split %aitext12 using the splitter to separate the number and its data unit. For me, I set it to "MB"
Variables --> Variable Set. Set Name to %datamb and set it to ceil(%aitext121). This will round-up the data usage to the nearest whole number, so it will display properly in Zooper Widget.
(OPTIONAL): Plugin --> Zooper Widget Pro Variable. Set #TDATAUSAGE# to %datamb. Same idea as before.
Finally, here's what my Zooper Widget looks like (along with my config). My usage had just reset recently so you can't really see much of the progress, though:
Great work, any chance to posting the script?
Sent from my Nexus 6P using Tapatalk
djide said:
Great work, any chance to posting the script?
Sent from my Nexus 6P using Tapatalk
Click to expand...
Click to collapse
I've placed the XML files as attachments to the thread. Cheers!
When I run the task it shows me this error and how or where do you make the or find the widget?
TeriusPR said:
When I run the task it shows me this error and how or where do you make the or find the widget?
Click to expand...
Click to collapse
Can you provide a screenshot of the pop-up that shows up when you enter the USSD code? As for the widget, you would have to download Zooper Widget from the Play Store, then create a "Progress Bar" widget and for the number put in the variable that Tasker is setting, as shown in my screenshot. For the min put 0 and for the max put your data limit (for me, it's 5000MB)
This is the only popup, and then I receive a text message with all the data usage's numbers.
TeriusPR said:
This is the only popup, and then I receive a text message with all the data usage's numbers.
Click to expand...
Click to collapse
Since your carrier is sending you text messages, you will have to intercept the text message content in order to get the data you want. My profile won't work for that, but luckily intercepting text message content is rather simple.
Simply create an Event, go to Phone --> Received Text. For the Sender, set it to the carrier's number that they text you from. You can leave the content part blank, or you can input a unique phrase from the text message that always stays the same so Tasker will only trigger off of these texts and not any other texts your carrier might send you. Then in the task, all the data you need to process will be stored in %SMSRB, which holds the SMS text content. Simply split until you get the data you've used each month and then you're golden.
Great tutorial! How do you create the widget? Sorry, noob here...
also, what if I want to use different source (other than USSD), like SMS. Since my data usage in USSD only shows unlimited (I'm using unlimited plan with FUP), but when I use SMS, it's showing my left data usage.
Thanks before
The event part was pretty simple but setting the task gave me a little of problem because I'm not sure how to split those variables and what name exactly put in. Do I need something more?
not works for me
it getting error at variable split
Variable split error
To those of you getting an error when trying to split the variable, see this attached screenshot. It works!
Thanks OP. Good idea.
Hey , didnt manage to understand whats the the USSD code you mention at the firsts steps of the guide.
Is it the code before the number of a phone?Of my phone or what? :/
vasilis_ said:
Hey , didnt manage to understand whats the the USSD code you mention at the firsts steps of the guide.
Is it the code before the number of a phone?Of my phone or what? :/
Click to expand...
Click to collapse
It's a "number" you can call. It's different for every carrier but it usually involves a * and a #.
When you call that "number" you get a pup up dialog with some I formation about your sms/phonecalls/data etc.
MishaalRahman said:
If you're not using an unlimited minutes/data plan, then you might be finding yourself monitoring your usage so you can stop yourself from incurring significant overages on your account. You can use a third-party widget or get notified from your carrier's app (if such a feature exists) but the disadvantages of these are a) the theming abilities of these widgets are limited or b) your carrier's app isn't all that great.
Using Tasker, AutoInput, and USSD codes you can easily grab this data and manipulate it however you want. In my tutorial, I will be grabbing the minutes/data used from T-Mobile USA and incorporate it into a Zooper Widget.
Prerequisites
AutoInput to query the text on the toast input.
USSD codes you can run that will provide you with the remaining minutes/data left in your account. You will have to look these up for your carrier.
OPTIONAL: Zooper Widget, for displaying the minutes/data in the form of a progress bar.
I'm not defining any contexts here for you, but you can set these tasks up to run on whatever trigger you want. For instance, for me I have these two tasks run every night at 1am to update my Zooper Widgets.
Instructions
Run the USSD code you want to automatically grab at least one time manually in the phone app. Take a screenshot or write down the text used for reference. It's less than 160 chars since it's an SMS, so don't complain about having to write (You could use Flash action to show what the output is, that's up to you though)
Create a task and call it "Call Usage."
Phone --> Call. Set the Number to the USSD code that will return how many minutes you have left. For me on T-Mobile USA this is #646#. Check "Auto Dial."
Plugin --> AutoInput UI Query. Check "Only Visible" and go down to "Text" and put in some unique, recurring text from the USSD code pop-up that AutoInput will wait to see before querying the screen. For me, I used "Addl minutes are charged" because I'm on a pre-paid plan.
Plugin --> AutoInput Action. This one is a bit wonky to set up, but basically you'll want to have AutoInput ready to record your tap input while the USSD is already on screen. To do this I would recommend setting a wait function before running the USSD code, then quickly going to AutoInput and starting the record input function. Once the USSD code is on screen, you can record the input. Optionally, you can use an input tap to have it tap anywhere on the screen to dismiss it.
Variables --> Variable Split. Split %aitext(1) in an attempt to isolate the amount of remaining minutes you have. For me, I set the Splitter to "You have"
Variables --> Variable Split. Split %aitext12 to fully isolate the number value of the remaining minutes. Here, I did "included minutes" as the Splitter.
Variables --> Variable Set. Set Name to %calltotal and set it To your total minutes minur %aitext121. Check "Do Math". This will determine how many minutes you have actually used.
(OPTIONAL): Plugin --> Zooper Widget Pro Variable. Set #TCALLUSAGE# (which should be written as CALLUSAGE within the ZW configuration, but is presented to ZW as variable #TCALLUSAGE#) to %calltotal. Now you can display this variable as a part of any Zooper Widget you like!
Create a new task called "Data Usage."
Phone --> Call. Number is the USSD code that tells you the data remaining in your plan. For me on T-Mobile USA it's #932#. Again, set it to "Auto Dial."
Plugin --> AutoInput UI Query. Again, like before, click on "Only Visible" and for Text set something unique from the USSD code pop-up that will make AutoInput query the screen when the text pops up.
Plugin --> AutoInput Action. Do the same as before, hell, you can even copy/paste the same action from the previous task to dismiss the pop-up!
Variables --> Variable Split. Split %aitext(1) to isolate the amount of data used. For me, I put "You have used" as the splitter.
Variables --> Variable Split. Split %aitext12 using the splitter to separate the number and its data unit. For me, I set it to "MB"
Variables --> Variable Set. Set Name to %datamb and set it to ceil(%aitext121). This will round-up the data usage to the nearest whole number, so it will display properly in Zooper Widget.
(OPTIONAL): Plugin --> Zooper Widget Pro Variable. Set #TDATAUSAGE# to %datamb. Same idea as before.
Finally, here's what my Zooper Widget looks like (along with my config). My usage had just reset recently so you can't really see much of the progress, though:
Click to expand...
Click to collapse
I found out an app which does the same thing and has a well defined widget too
https://play.google.com/store/apps/details?id=fahrbot.apps.ussd.widget.lite
Hello, i just found out this thread. i am sorry for bringing up a year old thread, but I have had no luck finding something like this a little fresher.
I have been trying to get this to work in my phone(GS6) and my carrier(Claro Dominicana).
By the time my task reaches the variable split step i get an error. I cannot post the image because I am new to the forums. But basically it says the following: "Variable split: can't split unset value to set %aitext12"
I hope some of you can point me in the right direction.
Regards
NEED HELP:
I'm trying to create a button in a scene that will delete the text from textEdit box.
Any idea if this is possible. Tried adding %null but nothing.
Cheers
Will setting it to a single space (" ") do it?
Vagelis1608 said:
Will setting it to a single space (" ") do it?
Click to expand...
Click to collapse
In that case I will get a space that I don't want for the future text. Other ideas?
SOLVED
Deleated edit text box, put a normal text box and in the Tap section used Variable Query.
Scene test
Text box
UI
Name: Text box test
Text: %Text
TAP
Variable query:
Name: insert text
Variable: %Text
Default: Enter text here
I'm trying to follow this how-to: Dynamic Home Button Behavior (GrogBase), but I am having problems sending and receiving an intent. Can anybody tell me how to format the intent to be sent by a task, to be received by tasker?
1. Just create a task with a "send intent" action and fill in the first field (action): TEST_ACTION
2. Now Create a profile (Event, Intent received) and again, fill in the first field (action): TEST_ACTION
Then add a popup or vibration or something as a task to see whether it will work.
Now go back to the task from 1. and run it.
This should work.
(Credit goes to @ascsa who explained it to me here)
Hello,
I have made an task with an Popup, there i wrote an title and an text in it.
Now i created an scene for this.
I put an "Text" field into it and named it "Text1"
Now when i change the Layout to this new scene it shows my text from the popup in the Text fielt, but not the Title of the popup. How can i show also the title of my popup? What do i have to do in my scene to show the title and the text of my popup?
Greets, firemouz
If I understand correctly, the scene you created has just a text element named "text1". That element correctly displays the text you entered into the text field (either static text or a variable).
It sounds like you need to add a second text element for the title and position that element at the top of the scene for a common placement of a title.
And how can i tell the second text field that a want to see the title from my popup in it?
I did this already and named it "title1" (because i had to name the first one for the text "text1").
But i do not get the title displayed.
EDIT:
Got it. When i name it "Title" it is working!
Glad you solved your problem. Sorry, I missed the fact that you were still using the pop-up action (as opposed to show scene) with your new scene.