5,594,386 Members 35,386 Now Online
XDA Developers Android and Mobile Development Forum

[v1.3] Tasker: Screen off=wifi/data off(no traffic+)AutoSync+Night/Reduce CellStandby

Tip us?
 
parthipanramesh
Old
(Last edited by parthipanramesh; 26th April 2013 at 04:07 PM.)
#1  
Senior Member - OP
Thanks Meter 260
Posts: 258
Join Date: Sep 2012
Location: Idar-Oberstein
Default [v1.3] Tasker: Screen off=wifi/data off(no traffic+)AutoSync+Night/Reduce CellStandby

Cell Standby Battery Drain:

Hey Guys!!
Maybe some of you know it. The cell standby drains a lot of battery. I live in a mounterial arrea and it's really annoying. So I searched a bit on Google and build a small Tasker "Script" to reduce the draining. I'm using it now for 6 weeks and it's working good! It reduced my cell standby from 35% to 2%.

So what's the magic?
First tasker will turn Airplane Mode (only cell!) on if you don't have signal. Then it'll wait for 5 minutes and check it again. Yes this sounds really simple but it was hard to build it.
I hope I can help you with sharing my experiences!

Screen off=data/wifi off it no traffic (with Night Mode):

Hey Guys, I have been looking for a solution for this problem for quite a while myself. Now I found a good solution to collect the current traffic on all interfaces. I will share a detailed explanation on how to set it up.
First off, what will happen?

If you want tasker to turn Wifi or Mobile Data off when you the turn Screen off normally you have the problem that it will interrupt all downloads. This Profile will try to read the traffic. If the traffic is below 15 kb it will turn wifi or mobile data off. If not it’ll wait until it is below 15kb. Later If you turn your screen on again tasker will activate mobile data and wifi. It'll wifi doesn't connect to a network (in the next 30 seconds) it will turn wifi off.

How does Tasker work? How can I optimize these profiles/tasks for my needs?
First what does tasker do? This is for the people who don't understand tasker. Tasker has 4 tabs (Profiles, Tasks, Scenes and Vars) but I won't talk about Scenes cz I didn't uses it yet. I also won't talk about Vars (variables) cz they are self explaining.

What are Profiles?
Basically profiles contain conditions (for example if display on/off or wifi on/off) and run a task if the condition is true. Example: If display off turn wifi off.
What are Tasks?
A task is something like a list of actions which the phone should do. (for example turn data on/off or run a specific app)

How do the profiles from this thread?
The profile AutoSync (Screen off) runs every 10 minutes while the screen is off. It turns data/wifi on checks for new messages and turns it off. It has a variable called "%SLEEP". It will only run if "%SLEEP" doesn't match "1".
The profiles Display (Data) and Display (Wifi) turns data/wifi on when the user turns the screen on. When the screen is off again it will check traffic for 30 seconds. If the traffic is below 15kb/s it will turn data/wifi off. If not it will wait 2 minutes and check the traffic again for 30 seconds until the traffic is below 15kb/s.
The profile Night (week), Night (weekend) turn the phone into airplane mode and sets the variable "%SLEEP" to "1".
The profile Wifi connected just changes the variable "%CONNECTION to "1" or removes the "1". This is needed for the Display (Wifi) profile.

On my todolist:
  • You say..
Changelog v1.3:
  • Added Greenify's hibernate now to both screen off tasks
Changelog v1.2:
  • Added AutoSync (every 10 minutes if screen is off)

I'm using this profiles on my Samsung Galaxy Nexus and it works very well!!
Feel free to ask me if you have problems! I'll try my best to help you.

These profiles include the greenify hibernate action from its plugin. If you have troubles with it you have to remove and readd it (on both Screen off tasks) cz my plugin is german. (plugin → hibernate)

You need Secure Settings for tasker or it won't work!! I used Secure Settings because Secure Settings can off only the cell radio. Tasker supports it, too. But not for Jelly Bean and I'm using 4.2.2 :/

How to import *.prj.xml files:

Unzip the *.prj.xml file in your Tasker/projects directory and then import it in Tasker by long-clicking the home icon or any of the other tabs. If you don't have the home tab, swipe down from the top in Tasker to show the tabs. (beginner mode must be disabled!)
Samsung/Google Galaxy Nexus | Paranoid Android - AOSPA 4+ | Latest Fancy Kernel
The Following 95 Users Say Thank You to parthipanramesh For This Useful Post: [ Click to Expand ]
 
Senrir
Old
#2  
Junior Member
Thanks Meter 5
Posts: 28
Join Date: Nov 2012
Thanks for this 8D!

Useful for a beginner like me ^^!
 
The-Droidster
Old
(Last edited by The-Droidster; 6th February 2013 at 06:40 PM.)
#3  
The-Droidster's Avatar
Senior Member
Thanks Meter 779
Posts: 1,069
Join Date: May 2012
Location: XDA 24 x 7
In task screen off, why do you wait for 30 sec's in Action number 5? Also how important is the Stop Task Action? What happens if I don't include it? I mean anyways, the following 'else' won't be executed if the Mobile data turned off by the 'if'.
 
kala123
Old
#4  
Member
Thanks Meter 11
Posts: 87
Join Date: Nov 2009
Just what I looked for, but How can I install your *.zip file to tasker? I just cant install it, any hint? where should I put the zip file?
 
The-Droidster
Old
#5  
The-Droidster's Avatar
Senior Member
Thanks Meter 779
Posts: 1,069
Join Date: May 2012
Location: XDA 24 x 7
Quote:
Originally Posted by kala123 View Post
Just what I looked for, but How can I install your *.zip file to tasker? I just cant install it, any hint? where should I put the zip file?
unzip it to /sdcard/Tasker/auto-import. Then import it using tasker.
 
parthipanramesh
Old
#6  
Senior Member - OP
Thanks Meter 260
Posts: 258
Join Date: Sep 2012
Location: Idar-Oberstein
Quote:
Originally Posted by The-Droidster View Post
In task screen off, why do you wait for 30 sec's in Action number 5? Also how important is the Stop Task Action? What happens if I don't include it? I mean anyways, the following 'else' won't be executed if the Mobile data turned off by the 'if'.
You have to wait 30 seconds or how long you want to wait cz in action number 2 tasker gets a traffic number from the system. After 30 seconds it gets another. Tasker subtracts the values to get the actual traffic in bytes. So Tasker can look if the traffic is below 15 kb/s. Yes you're right. It's my fault. You don't need the Stop Task Action. It's from the old Script. I forgot to remove it. Thanks for your hint!
 
RLicher
Old
#7  
Junior Member
Thanks Meter 1
Posts: 7
Join Date: Jan 2013
Hi parthipanramesh,

what I metioned inside the other Thread seems to be working A okay...
What are the modifications/fixes in this version? I can't tell from looking at it here.
 
parthipanramesh
Old
#8  
Senior Member - OP
Thanks Meter 260
Posts: 258
Join Date: Sep 2012
Location: Idar-Oberstein
Quote:
Originally Posted by RLicher View Post
Hi parthipanramesh,

what I metioned inside the other Thread seems to be working A okay...
What are the modifications/fixes in this version? I can't tell from looking at it here.
Hi RLicher,
Some people had the issue with the maths calculation of CHECKB_WIFI - CHECKA_WIFI. So tasker will set the variables to 0 if they aren't set. (cz wifi is off or something else). And I deleted/merged some Actions.

You can use the version from the other thread if you don't have problems
Samsung/Google Galaxy Nexus | Paranoid Android - AOSPA 4+ | Latest Fancy Kernel
The Following User Says Thank You to parthipanramesh For This Useful Post: [ Click to Expand ]
 
nappent
Old
#9  
nappent's Avatar
Senior Member
Thanks Meter 80
Posts: 418
Join Date: Sep 2010
Location: Bothell, Wa
I'm using this on SGS3 but notice two issue... While listening to Pandora when a song ends the data or wifi will get disabled so the next song cant start. Second wifi or data will not be reenable when the screen is enabled.

For the record i just imported the files within the zip.
 
parthipanramesh
Old
(Last edited by parthipanramesh; 17th February 2013 at 01:15 AM.)
#10  
Senior Member - OP
Thanks Meter 260
Posts: 258
Join Date: Sep 2012
Location: Idar-Oberstein
Quote:
Originally Posted by nappent View Post
I'm using this on SGS3 but notice two issue... While listening to Pandora when a song ends the data or wifi will get disabled so the next song cant start. Second wifi or data will not be reenable when the screen is enabled.

For the record i just imported the files within the zip.
First you have to increase the 30 seconds from the two Screen off tasks [A5] because Tasker checks the traffic for 30 seconds. If Pandora loads a song for example in 40 seconds Tasker will disable data and wifi after it has been loaded. So data and wifi are turned off when Pandora tries to play the next song. Increase the value and you should be good.

And for your next issue:
Delete the imported profile and create a new profile:
Name: Whatever
Context: State → Display On
Task: Create a task which enables data and wifi
Exit Task: Screen off
Samsung/Google Galaxy Nexus | Paranoid Android - AOSPA 4+ | Latest Fancy Kernel

Tags
data, screen off, tasker, traffic, wifi
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes