Enter airplane mode when charger unplugged from wall and vice versa

1,329 views
Skip to first unread message

pktsym

unread,
Aug 2, 2011, 6:32:37 AM8/2/11
to Tasker
I recently purchased Tasker off the market ( sounded easier than the
direct purchase ) ... and was quickly able to create a couple time
based repeating tasks setting the phone up to disconnect from wifi,
wait 15 seconds, and then reconnect to wifi. This is working good now
I'm seeking advice for another task that is not as straight forward.

Can Tasker do this:

Enter Airplane mode when charger is not plugged in, and then Exit
airplane mode when plugged back in.

Thanks for any tips.

Wes

m.klinge

unread,
Aug 2, 2011, 10:29:38 AM8/2/11
to Tasker
Yup do you want it to react by a specific time setting eg "From 22 to
06 if not plugged in to charger turn on air plane mode"?

If so you can do it like this:
Create a profile called power
State --> power choose any
Make a task called "power on", make a variable set. Let's call the
variable %PWR and set it to 1.
Long press and add an exit task (call it "power off"), make another
variable set, this time set %PWR to 0.

Now for the main task to control your time setup:
Create a new profile, choose Time and set it to the desired time.
Create a task called "airplane on", in "Net" find airplane mode and
set it to "On". Tick the if box and set %PWR ~ 0.
Create an exit task called "airplane off". Same as above but choose
"Off". Tick the if box and set %PWR ~ 1.

Your done! Now every time you plug your device to a charging unit
(being USB or charger) it will set the variable to 1. And every time
your time condition is met it will execute the airplane task (turn on
airplane mode) if and only if the power variable is 0 (which of cause
means that the device is not connected to a power source) ;)

Hope this helps ;)

//M

m.klinge

unread,
Aug 2, 2011, 10:34:32 AM8/2/11
to Tasker
I assume the answer above is what your seeking, however if you for
some reason I don't know, really want you phone to be switched to
airplane mode every time it's not connected to a charger it's ever
easier ;)

Make a new profile called power, choose power in the state category.
Make a task that turns off airplane mode.
Make an exit task that turns on airplane mode.

Done and your happy ;)

//M

pktsym

unread,
Aug 2, 2011, 3:14:39 PM8/2/11
to Tasker
Thanks so much for the quick reply... I'll try this out today. Many
thanks!

pktsym

unread,
Aug 4, 2011, 11:16:05 AM8/4/11
to Tasker
Thanks it is working great..... however.... I have another task that
turns off wifi waits 14 seconds and then turns wifi back on every 30
minutes.... If the phone happens to be in airplane mode and the wifi
off/on task runs the phone actually turns on wifi even though airplane
mode is still active. To clarify I get the wifi icon and the airplane
icon in the notification area at the same time and the internet
works.

So how might I go about suspending the wifi off/on task while the
phone is in airplane mode?

Thanks for any tips. Such a cool product.

On Aug 2, 9:34 pm, "m.klinge" <klingenberg.mor...@gmail.com> wrote:

Kage_

unread,
Aug 4, 2011, 9:57:55 PM8/4/11
to Tasker
Put a stop in the wifi task that occurs when the other profile is
active. This could be done in the task itself or you could add an
inverted context that looks at the status of the airplane profile.

Kage_

pktsym

unread,
Aug 5, 2011, 4:34:55 PM8/5/11
to Tasker
Thanks for the response.... is there a step through on the wiki that
teaches one how to do stop one task if another is active? Or any other
documentation on how to do that? Thanks again.
Reply all
Reply to author
Forward
0 new messages