• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Stop tasker from turning things off that are manually on

bmore1229

Lurker
Mar 18, 2013
7
0
My profile

Any text recieved from gmail. (gmail forwards all Mail to SMS)

Turns on Wifi, data, and sync. For 2 mins. To get the new Mail. Then turns off the Wifi, data, and sync

My problem is if I'm manually using Wifi/data on the phone. This profile turns off the Wifi/data when its done.

So my question is if Wifi or something is already on manually. Is it possible. To set up the profile so things don't turn off I'f they were on before the profile started to run? And how?

Thanks for the forum, and any help.
 
I usually use ZDBox widget to turn things on and off manually.

Screenshot attached.

Is toggle thru tasker what I should be using to do it manually?
 

Attachments

  • uploadfromtaptalk1364647937291.jpg
    uploadfromtaptalk1364647937291.jpg
    25.1 KB · Views: 85
Upvote 0
I got it. I made a variable for tasker to know if the Wifi was on before the task started. So it knows if it should turn it off or not.

Quick Sync 2 (267)
A1: Vibrate [ Time:50 ]
A2: Variable Set [ Name:%WIFION To:1 Do Maths:Off Append:Off ] If [ %WIFI ~ on ]
A3: Goto [ Type:Action Number Number:5 Label: ] If [ %WIFI ~ on ]
A4: WiFi [ Set:Toggle ]
A5: Auto-Sync [ Set:Toggle ]
A6: Wait [ MS:0 Seconds:0 Minutes:2 Hours:0 Days:0 ]
A7: WiFi [ Set:Toggle ] If [ %WIFION ~ 0 ]
A8: Auto-Sync [ Set:Toggle ]
A9: Variable Set [ Name:%WIFION To:0 Do Maths:Off Append:Off ] If [ %WIFI ~ on ]
 
Upvote 0
Ok i got rid of the varibles. and toggle.

I made one profile for when im connected to the wifi and i recieve a text from gmail. syncker force runs. i made another one for when im not connected to the wifi. it turns on the wifi syncker runs and the wifi turns off after 2 mins.

I did the same for data it knows im not home by looking at what cell towers are near. if data is on syncker will force run if a sms comes from gmail. if its off it will turn the data on run force sync then turn off in 2 mins.

i usually do not leave wifi data or sync on eats too much battery. thats why i wanted it set up this way.

i do have one more question. winamp or anything that streams on the internet. if i set up winamp to turn on the wifi i open a shoutcast stream. its fine. but as soon as i hit the home key. the wifi turns off. how can i make it so it knows winamp is still open in the background?
 
Upvote 0
i do have one more question. winamp or anything that streams on the internet. if i set up winamp to turn on the wifi i open a shoutcast stream. its fine. but as soon as i hit the home key. the wifi turns off. how can i make it so it knows winamp is still open in the background?


Look at Michael Yaeger's post here:
https://groups.google.com/forum/#!msg/tasker/KVhuDORpMII/YDMsW9A00_cJ

Here's a little routine I whipped up with the help of some poeple on this forum that checks to see if I've shut TuneIn Radio down and adjusts my volume accordingly. It doesn't require root and doesn't do it's thing until I actually shut TuneIn down. Putting it in the background doesn't trigger the profile. Feel free to use any of it you can to accomplish your goals. It activates when TuneIn is in the foreground and when TuneIn is no longer in the foreground it waits 10 seconds (it's only an exit task) and then uses the linux command ps to load the process list into a variable. If the variable contains the value tunein.player it does nothing and waits until it is triggered again.

Profile: TuneIn (20)
Application: TuneIn Radio
Exit: Anon (19)
A1: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A2: Run Shell [ Command:ps Timeout (Seconds):0 Use Root:Off Store Result In:%ProcessList ]
A3: If [ %ProcessList !~ *tunein.player* ]
A4: Media Volume [ Level:14 Display:Off Sound:Off ]
A5: End If

I'm going to suggest a modification to meet your needs asuming you want to toggle wifi based on streaming app running (you may need to modify it further if you want to also use data depending on locations)

Profile: TuneIn Modified
Application: TuneIn Radio, another app, yet another

Enter:
Wifi On

Exit: Anon (19)
A1: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A2: Run Shell [ Command:ps Timeout (Seconds):0 Use Root:Off Store Result In:%ProcessList ]
A3: If [ %ProcessList !~ *tunein.player*/*another app*/*yet another* ]
A4: Wifi Off
A5: End If
Run the shell command with each app running so you can find the correct text to use for matching.

The entrance task fires whenever you enter program or when you bring it back to foreground after being in background. Turn wifi on in either case (it is already on upon reentering... no big deal).

The exit task fires whenever you exit the program or send it to the background. The shell command checks if process is still running so we can distinguish which is the case. Only if the app is no longer running will the exit task turn off wifi.
 
Upvote 0
I see that action A2 got a little garbled by smiley face attack ;-)
It is run shell command with ps in the command box.

The command will spit out a bunch of stuff that is easier to inspect on pc when you're looking for those app names. If you want to whittle it down to a smaller list, expand the command as follows:
ps | grep app_

(that will only output lines containing app_... which includes all apps but excludes a bunch of other stuff)
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones