Under Variables, you'll need to create two variables. I called them %DATA and %SCREENOFFTEST.
Under Profiles, create a profile called Screen Off Data Off. The triggers are the event Display Off and the state Not Power Any. Then create a Task called Screen Off Data Off.
You can see what I built here. The basic gist of it in plain English is that it turns on a temporary test to see if the screen stays off. Then it waits 15 minutes. If the test is still on, it turns the data off, turns auto-sync off, and then cancels the test.
Tapping the wrench in the bottom-right corner brings up the Task Properties. Set the Collision Handling to Abort Existing Task. This means if you turn the screen off and then turn it on again and turn it off again within 15 minutes, the first instance of this task will be aborted in favor of the most recent time you turned the screen off.
The next Profile is called Screen On Data On. The triggers are an event of Display Unlocked and a state of Not Airplane Mode. Then you'll also create a Task called Screen On Data On.
For this profile, you can see the end product again. The gist is: if you wake up the screen, that test from earlier should be off. And then if data is off, you turn it back on again.
I made the timeout 15 minutes so that the data isn't constantly turning off and on again, but I still get the battery life savings. I also turned off auto-sync for good measure. It doesn't really need to be off, though. If data is off, Android won't look to auto-sync. Lastly, I made the trigger for screen on data on to be unlocking instead of just turning the display on. That's because on my phone (the Galaxy Nexus) it can be sometimes easy to accidentally jostle the power button, so I don't want to turn on data until I unlock the phone, which means I'm actually using it for something data-related. The data reconnects fairly quickly on the Galaxy Nexus (on my old phone—the MyTouch 4G—the reconnection time was much longer).
I hope you found this helpful!
Hi ubuntucat (love both ubuntu and cats btw),
I’m new to Tasker and still getting the hang of it. I find this tutorial very useful and concise. Thank you very much for this.
My problem is the wrench icon. There’s nothing there but a check icon, x icon next to it, then a play icon at the right. I tried menu and long-pressing everything but find no option for “task properties”.
I don’t know if this is your site or not:
http://www.psychocats.net/ubuntu/puregnomenatty
But could you please remove the commands that remove mysql server? Its too late for me as it now destroyed 2 days of sleepless data entry, but maybe some other poor sap won’t be destroyed by your handy “Hey lets remove Kubuntu” script.
That is my site. I can’t remove commands, because the command is created based on a default installation and the packages added (and thus later to be removed). How would I know if someone needed to use MySQL server? What I did instead was to change the disclaimer to be more emphatic and explicit.
I use GTalk a lot during the day, and this profile would kill my GTalk connection when the screen is off (normal situation when I am at work), right? Is there any other way I can save juice at work? Ah, I don’t have wifi available here (damn company policy).
I already have a profile that disables auto-sync (so I don’t get too much distraction from personal mail and Facebook). Is this enough? I mean, my power savings disabling auto-sync are significantly bigger than disabling mobile data?
I haven’t found any significant savings with turning auto-sync off. In fact, most of the “official” battery-saving tips you see on tech blogs are generally worthless. Turning off GPS does nothing, as GPS sucks battery life only when it’s actively being used (say, for Maps or Navigation). Turning off auto-sync does virtually nothing (at least in my experience). Dimming the screen excessively does very little for battery life (though there is a difference between totally dim and full brightness). The only things I’ve found to make a significant difference or turning off mobile data and using wireless.
I have this set up and everything seems to be set up exactly, but I am coming across a slight issue…
When it enables data, the data doesnt always turn on. I went to check if the data is actually enabled in the settings and it is. The only way to reenable the data is to switch from 4g to CDMA then back to 4g and the data comes back on.
Im running a Galaxy Nexus CDMA rooted
any help you can offer would be appreciated!
Cool, trying this out now! Think i’ll set it to only do it’s work between 1AM en 7AM though, to save a little energy and maybe keep my razr maxx going 3 days!
Thanks. Very helpful. I changed your profile a little bit so that it does the same thing to my WiFi instead of data connection. I am just trying to figure out one last thing: Would be cool if wifi/data was only switched back on after unlocking the phone if it was activated in the first place. I tried to use another variable but can’t get it running. Suggestions anyone?
What do the red lines mean in the 3rd screenshot?
It’s just an indent to indicate the beginning and end of the if statement.
Hey,
could you offer the required profiles for download?
Thanks a lot!
I love this setup.. but i have a problem..suppose i am downloading something big through my phone, will the data get cut off after the screen off after the 15mins..and the download might fail…
Is there any way that the phone knows that we are downloading something so that it can execute the tasks only after the download…?
Hey,
I’ve been using such tasker profiles for scheduled and event triggered switching of MobileDate on my MotoDefy since 2 year with success.
Now I’ve “upgraded” to a LG p880 (v4.0.3). On this phone I’ve the problem that any switching of MobileDate wakes-up the screen. I’ve try also the APNDroid Plugin, and JuiceDefender all of them shows the same Problem.
Does anybody know a solution?
Thanks a lot!!
Hey psychocat, thanks for posting this. I actually found it when googling “battery saving tasker profiles” it was the 6th result. Which is pretty cool, since way back when I first started Ubuntu (before my moderator days) Your tutorials were the exact ones I used to begin learning about it :)
Maybe you should make another blog for tasker, you seem pretty good at it :D
Hello,
are you still here? Your great profile worked for me until lollipop ;-(. How am I supposed to live now???
Best regards
Unfortunately, I don’t use this profile any more…