Go Back   Android Forums > Android Discussion > Android Applications > Tasker

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old August 24th, 2010, 01:23 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Aug 2010
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default Tasker if statements

I have been using tasker for a few days now in the trial period and I love it. It may be the best app I have used so far. I am getting a a point though where I am at my limit in terms of being able to get it to add additional conditions which primarily relate to if statements. I am hoping folks on this forum can help as I searched and did not see anything to guide me with my specific issues.

Problem #1. When I leave home zone, I turn on GPS which I want to put a condition in that says wait 30 minutes and if Navigation is not on, turn GPS off so as to save battery. Most times I will enter the work zone in that timeframe which will turn it off anyway but on the odd chance I am taking a 2 hour road trip and not using GPS, I don't want to kill the battery.

Problem #2. How can I use the profiles in the if statement? If not in home zone (circle on the map), do xyz or if not in home zone or work zone, do abc. Is this possible?

Problem #3. Can I get tasker to run a widget from the phone, not an app but an actual widget related to an app?

I have everything else working great but this fine tuning will make it work even better.

Thanks.

lambed3 is offline  
Reply With Quote
sponsored links
Old August 24th, 2010, 01:56 PM   #2 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,122
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 59
Thanked 391 Times in 324 Posts
Default

If statements in Tasker can't refer to contexts. You could simulate doing so by setting a variables:

Context: Location <home>
Enter Task: Variable Set %WHEREAMI = home
Exit Task: Variable Clear %WHEREAMI

Context: Location <work>
Enter Task: Variable Set %WHEREAMI = work
Exit Task: Variable Clear %WHEREAMI


And then in some task use an if statement like:

If $WHEREAMI Matches home/work


As for running a non-Tasker widget from a Tasker task... you might be able to do it using "intents" in Tasker, but I'm not sure (or even optimistic).

And for turning GPS off with a 30 minute delay after leaving home, you could use an exit task on your home profile, with a Wait followed by GPS Off, but you would need to set the task to keep the device awake in order for the task to complete as intended. This is because the Wait (as currently implemented) doesn't keep counting once the device goes to sleep. So in the long run it may be more battery efficient to just leave GPS on and let the device sleep.
UncleMike is offline  
Reply With Quote
The Following 2 Users Say Thank You to UncleMike For This Useful Post:
chrlswltrs (August 24th, 2010), lambed3 (August 26th, 2010)
Old August 24th, 2010, 04:26 PM   #3 (permalink)
New Member
Thread Author (OP)
 
Join Date: Aug 2010
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

thanks. Very helpful.
lambed3 is offline  
Reply With Quote
Old August 24th, 2010, 07:37 PM   #4 (permalink)
Senior Member
 
chrlswltrs's Avatar
 
Join Date: Nov 2009
Location: Seattle
Gender: Male
Posts: 6,741
 
Device(s): Nexus 4 w/ LTE
Carrier: T-Mobile

Thanks: 1,174
Thanked 1,785 Times in 1,163 Posts
Thumbs up

Quote:
Originally Posted by UncleMike View Post
If statements in Tasker can't refer to contexts. You could simulate doing so by setting a variables:

Context: Location <home>
Enter Task: Variable Set %WHEREAMI = home
Exit Task: Variable Clear %WHEREAMI

Context: Location <work>
Enter Task: Variable Set %WHEREAMI = work
Exit Task: Variable Clear %WHEREAMI


And then in some task use an if statement like:

If $WHEREAMI Matches home/work


As for running a non-Tasker widget from a Tasker task... you might be able to do it using "intents" in Tasker, but I'm not sure (or even optimistic).

And for turning GPS off with a 30 minute delay after leaving home, you could use an exit task on your home profile, with a Wait followed by GPS Off, but you would need to set the task to keep the device awake in order for the task to complete as intended. This is because the Wait (as currently implemented) doesn't keep counting once the device goes to sleep. So in the long run it may be more battery efficient to just leave GPS on and let the device sleep.
I was just wondering this very thing today about using a profile as a context, thanks for this great explanation.
__________________
"Is life so dear, or peace so sweet, as to be purchased at the price of chains and slavery? Forbid it, Almighty God! I know not what course others may take; but as for me, give me liberty or give me death!"

-Patrick Henry, March 23, 1775
chrlswltrs is offline  
Reply With Quote
Old November 25th, 2012, 10:01 PM   #5 (permalink)
New Member
 
Join Date: Nov 2012
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

Definitely late to this thread, but regarding the GPS, Map, navigation needs, this could be done pretty simply via the App context using the Secure Settings plug in. Just add the GPS apps you want to the context, then create a task using the Secure Settings plugin to enable GPS when the app is opened.

Adding an exit task, again using the Secure Settings plugin to turn GPS etc. off when exiting. Works great! No need for location or time contexts (apologies if this is already covered).
BobMan is offline  
Reply With Quote
Reply
Tags
if statements, tasker


Go Back   Android Forums > Android Discussion > Android Applications > Tasker
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 03:43 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.