• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Limit mobile data usage with Tasker?

magma123

Lurker
Jul 1, 2018
3
0
Hi! I usually only use mobile data to check bus times and maps etc while out, so usually have more than enough data per month.

But sometimes I come home and forget that data is still on while wifi is switched off, and watch a few Netflix episodes only to discover I have used a huge amount of data unnecessarily. I know I could just keep wifi on all the time, but it actually seems to me that the phone sometimes chooses data over wifi even when wifi is on and available.

Anyway, if anybody knows a way to avoid this with Tasker, I would greatly appreciate it. One way would be to always switch data off after it has been on for, for example, 10 minutes, meaning that a potential Netflix episode would stop and I would see it and switch to wifi. An even better solution would be if data always switched off after having been actively in use for 10 minutes, so incoming emails and other low-amount-of-data material would still be coming in throughout the day. The very best solution would be to set a maximum amount of data that can be used within a set time frame any time.

I have not been able to find any apps that do any of these things, but please let me know if you do. But Tasker seems like an app that could do it. If you know how to do any of the things above in tasker, I would be grateful. Please say how to do it in terms of which buttons to press instead of a code.

Best regards.
 
This is a classic solution.

When I was not on unlimited I ran with two profiles. When in range of my office WiFi is on, When not in range of my office WiFi is off and I am on mobile. This allowed me to visit customer offices without constantly trying to connect to their WiFi.

The waiting is to allow time for syncronization.

Profile: tlaOfficeNear (30)
State: Wifi Near [ SSID:XXXXXX-2.4GHz/XXXXXX-5GHz MAC:* Capabilities:* Min. Activate Signal Level:4 Channel:0 Toggle Wifi:Off ]
Enter: tlaOfficeNearEnter (32)
A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A2: Perform Task [ Name:tlaWiFiOn Priority:%priority

tlaWiFiOn (98)
A1: Variable Set [ Name:%work To:WiFi - On Recurse Variables:Off Do Maths:Off Append:On ]
A2: Variable Set [ Name:%work To:WiFi - Still On Recurse Variables:Off Do Maths:Off Append:Off ] If [ %WIFI ~ on ]
A3: WiFi [ Set:On ]
A4: Flash [ Text:%work Long:On ]

Profile: tlaOfficeFar (34)
State: Not Wifi Connected [ SSID:XXXXXX-2.4GHz/XXXXXX-5GHz MAC:* IP:* Active:Any ]
Enter: tlaOfficeFarEnter (35)
A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A2: Variable Split [ Name:%WIFII Splitter: Delete Base:Off ]
A3: Perform Task [ Name:tlaWiFiOff Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] If [ %WIFI2 !~ CONNENTION ]

tlaWiFiOff (95)
A1: Variable Set [ Name:%work To:WiFi - Off Recurse Variables:Off Do Maths:Off Append:On ]
A2: Variable Set [ Name:%work To:WiFi - Still Off Recurse Variables:Off Do Maths:Off Append:Off ] If [ %WIFI ~ off ]
A3: WiFi [ Set:Off ]
A4: Flash [ Text:%work Long:On ]

(The real SSIDs have been hidden in this post.)
(Removed need for scene processing task.)

… Thom
 
Last edited:
Upvote 0
Thanks very much! Strangely in Norway where I live, unlimited is not yet widely available.

I would like to try this out, althought I am not great with technology. Do you by any chance know about a website where I can find out what the different things mean?

Also, if anybody knows a simpler version that somehow cuts data after a set time/amount, that would still be interessting.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones