How To: Automatically Control WiFi to Conserve Battery on Your Nexus 5

Automatically Control WiFi to Conserve Battery on Your Nexus 5

If you've ever used the automation app Tasker, then you know exactly how powerful the tool can be. If you haven't, suffice it to say that there's virtually nothing on your Android phone that Tasker can't automatically do for you.

If you're looking to save some battery life on your Nexus 5, Tasker can be a great help. For instance, leaving WiFi on when you're not using it drains your battery—but remembering to turn it off when you leave and then back on when you get home can be a bit of a pain.

Follow these simple steps, though, and you can make Tasker turn your WiFi radio off when you leave home, then turn it back on when you return. Automatically.

Step 1: Install Tasker

Tasker is a paid app from Craft Apps EU, and it's honestly one of the best purchases I've made from Google Play. But if you're not sold on Tasker yet, or you're just strapped for cash, there is a free trial version available.

From your Nexus 5, tap this link to download the 7-day trial, then tap the download notification to launch the installer.

Step 2: Configure Tasker

Out of the box, Tasker is configured to accomplish many different tasks. But, one of the features we're using today requires that we enable an additional option.

From Tasker's home screen, press the menu button and hit Preferences. Tap the Monitor tab, then scroll down to the General Monitoring section. In here, tick the box next to Use New Cell API.

Step 3: Download Tasks & Profiles

Most of the hard work has already been done for us. Instead of manually creating each profile and its associated tasks, we can download a ready-made set of these.

You can even use Tasker itself to download these, but you'll have to trigger that from your phone's web browser. When you tap a Tasker-compatible download link, your phone will offer to user Tasker to complete the download. When asked, tap Tasker and then hit Always.

From the browser on your Nexus 5, tap each of the following links:

Tasks:

Profiles:

Step 4: Import the Profiles & Tasks

From Tasker's main screen, select and then tap the Profiles tab. From the menu that pops up, hit Import, then select WIFI Starter. Repeat this process to import the WIFI Stopper profile as well.

Next, select the Tasks tab, then tap it to bring up the menu. Select Import, then tap WIFI AP Search to import the first task. Repeat this process for the remaining four tasks.

In the end, you should have a total of two profiles and five tasks.

Step 5: Configure the WiFi Checks Params Task

The tasks and profiles that you just imported already have most of the information that they need to operate. One thing they don't already know is your WiFi network name, so you'll have to enter that one yourself.

From the Tasks tab, press Wifi Checks Params. Tap Variable 2, then select the second field to edit it.

From here, replace *MBJC* with the name of your Wi-Fi network. Be sure to type the exact name of your network here, noting that the name is case-sensitive.

Step 6: Scan for Nearby Cell Towers

This Tasker profile operates by turning your WiFi radio off whenever you go out of range of your router. It then turns your WiFi radio back on when you get home. It knows that you've arrived home by reading the ID number of the cellular network tower that you're connected to. If you're connected to the cell tower that's closest to your house, it enables WiFi again.

In order to "teach" this profile which cell towers are nearest to your home, you'll have to edit the Wifi Starter profile. Do this by tapping the title of the profile to expand it, then hitting the subset of text that reads Cell near.

Delete the text in the field at the top of this screen, as this is someone else's home cell tower. Now hit the Scan button to start looking for nearby towers.

This profile works best if you give it as much data about your nearby cell towers as it can get. While the scan is running, walk around your house so that it can pick up all of the nearby towers and the strength of the signal you're receiving from them.

After a few minutes, you can hit Stop to save your data, then back out to the main Tasker screen.

And that's it—Tasker will now automatically turn your WiFi off when you leave home. When you come back, give it a minute or two to read the nearby cell towers, and it'll automatically enable WiFi and you'll connect to your home's router.

If the Tasker trial expires and you still don't wish to purchase the full version, there is a similar app that can provide most of the same functionality. While it will take longer to disable your WiFi radio, it should still save a decent amount of battery life. Check out Nelson's article here for more info on that method.

Just updated your iPhone? You'll find new emoji, enhanced security, podcast transcripts, Apple Cash virtual numbers, and other useful features. There are even new additions hidden within Safari. Find out what's new and changed on your iPhone with the iOS 17.4 update.

20 Comments

Thanks! How can I modify these profiles/tasks to be able to connect my phone both to home and work wi-fi?

To simplify things, here's a different set of profiles that can be used to do this with two locations:

Just import these, then enter your home WiFi name in the field where it says HomeSSID under the WiFi Near A profile. Just below that field, delete the MAC address numbers and leave it blank. Then scan for cell towers under the Cell Network A profile. Repeat this process again at work with the WiFi Near B and Cell Network B profiles.

Thank you!

Thanks! I'm having issues with my wifi not turning off. The cell tower profiles work perfect, both options turn green when in location as expected. I have noticed that when I leave the cell range it turns off that profile, but the wifi profile is still green. I'm guessing it has something to do with the %WIFIC code. (i changed the names from "Near B" to "Near Work" etc)

Thanks for another great tutorial! This is very useful. I have a question though: sometimes it takes a little while until my WiFi is turned on (5min+). Is it normal? Is there any way I could make it faster?

I've noticed that same thing too. It's because the phone doesn't necessarily report a change in cell towers immediately.

One option to remedy this would be to expand the Cell Near range. Try going back to the section outlined in Step 6, but this time, walk a little further than just your house. Maybe make the block, if you feel up to it.

This way, you'll (hopefully) pick up more Cell Tower IDs from nearby and expand the "home" radius a little bit. In theory, that should cause the profile to trigger a bit earlier.

I'm unable to import I'm afraid. Using the latest Tasker version. Is it compatible?

I just tested with the new version of Tasker and I'm running into the same problem. Something must have changed in the way Tasker imports profiles. Let me play around with it a bit and see if I can figure out how to get it working on this new version.

Same problem here. Please let us know if you figure it out.

I am also unable to import. I hope someone can figure it out soon...

Yeah importing is still not working correctly. I am trying to figure out all the new variables etc... Tasker wasn't this hard before.

Does anyone have a screenshot of the WiFi stopper profile? Like others, I am unable to import the profiles. I managed to get the starter created from the screenshot on this page, but I don't see the other one.

@Chantal, I have the complete setup for the latest Tasker. Please let me know via PM if you are interested.

I am also interested in the newest setup for this. Thanks.

Thanks for useful share.

I have the following problem: My wifi is not connecting at all; though it disconnects when I go out of home. My wifi SSID has a space e.g., "My Wifi". Is this creating problem?

Any help would be highly appreciated.

Hi Thomas !

Thanks for this tutorial, very usefull. I've got the same problem than ABLAZE : when I get back home, Tasker's WiFi Starter profile is active, but my wifi doesn't connect at all. Are 4G relay a problem for Tasker ?

Thanks a lot if you're able to help us !
Have a nice day.

well it's good that tasker can do almost everything. the first thing I wanted it to do, I'm not sure it can, I hope I'm wrong.

What I want it to be able to do is to control the wifi signal strength that it's emitting. I have wifi routers that can drop down to 250 micro-watts, yes, 1/4 of 1 milliwatt. They can do this in my house and still pass 100 megabits/second.

I know that a smart phone inside my house with its stone walls is likely to be up near 2 watts to stay on the gsm network.

I'd like to be able to use a cell phone in my house and have it's entire communications coming through my wifi and home internet connection, phone calls, sms, internet, everything.

And I want that wifi at the bare minimum possible for the device.

Can tasker do all that?

Very useful tutorial, but what if I have multiple wi-fi hotspots I wish to include in the task? I can't go to all of them...

Share Your Thoughts

  • Hot
  • Latest