Tasker program to turn on WiFi and turn off mobile data at home - Advanced

I love my fairphone 2. It really is a great product. The problem I have is it has chewed through my mobile data on a few occasions. I’d like to write a project in Tasker to turn off mobile data and turn on WiFi when at home. There are some simple guides on line but none are advanced enough to do it while consuming minimum battery drain. Has anyone written a Tasker project that uses network location first and then when in the right area, checks for WiFi to confirm it and make the changes?

I’m doing this. I don’t know how to attach the xml files now, so I’m doing this a bit later and push the links

1 Like

I had this on a previous phone and it was draining my battery. Perhaps my intervals were too high. I’ll try to reproduce them cause I think the license for Tasker should still be valid.

EDIT: Oops, I just figured out I was using Automate and not Tasker. Is Automate better or worse? I don’t know.

1 Like

Here are my profiles.
Switch wlan on/off when entering/leaving a region (you have to add cell towers) https://drive.google.com/file/d/10N-B0EHGp0TinSoyGqqOfYUYL2zCnMhr/view?usp=drivesdk
When connected to wlan switch off mobile data (and lower the volume) and vice versa. https://drive.google.com/file/d/1H-FWZZv_9Ub1zfDT85hChvvKj0sB1wfg/view?usp=drivesdk

1 Like

If you do not want to use tasker for that, for this specific purpose there is a FLOSS app which does the job for you: Smarter Wifi Manager
I haven’t used it for a few months now but what I recall is that the app automatically collects the ids of cell towers that are available when you’re connected to a WiFi network. Whenever a known cell tower is available it turns on WiFi and whenever leaving known territory it turns WiFi off again.

3 Likes

Thanks. That’s helpful. My main interest is to turn off mobile data when at home as that has been expensive in the past.

Keep in mind that in Android you’ll need root access to switch on/off mobile data using a task.

1 Like

Thank you. Will these work without rooting the phone?

Just checked the tasks, and also saw that there’s some convoluted logic regarding sound. You will have to remove some if’s… I can’t say whether this (still) runs without root, I’m using it here (svc shell command), besides the old standard method, but in using tasker since Kitkat days. @Volker could be very correct

1 Like

I currently use Automate to achieve a goal similar to yours: I activate a “low sound” profile when at home or office and an “high” one when outside, it doesn’t use so much battery because it uses the system’s location provider to see if you are “inside” a zone or you you exited from that zone; the check is provided by event so it is done not so frequently and the processor can go to deep sleep.
I thought to also add Wi-Fi enabling/disabling exactly for the same reason of you so if you plan to use Automate just drop me a PM so I can share the flow with you and explain how to modify it for your needs :slight_smile:
Bye!

Are you able to test whether Automate will turn mobile data on and off with a non-rooted FP2? If it is able to, that would be a great help.

No, unluckily starting from Android 5 enabling/disabling mobile data requires root according to the help description of the Automate block, sorry!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.