Run a task alternately

51 views
Skip to first unread message

Viki Malik

unread,
May 22, 2018, 3:17:19 PM5/22/18
to Tasker
Hi

I drop and pick up my wife at her office daily
When I go to pick her in the evening, I call her to come outside of her office building
I call her when I reach a particular area
Which is few blocks From her office building so that when I reach her office she had enough time to get out of the building

I want a task which doesn't fire up when I am going to drop her in the morning
And when after picking her up when we are getting back to home

Thanks
Viki

Duck Redbeard

unread,
May 22, 2018, 3:53:36 PM5/22/18
to Tasker
Add a time context so that it only fires between certain times of the day. Or use %TIME variable, where if %TIME>16then run your task. My example is if the HOUR if the day is greater than 16. Since the time 4:25pm is expressed as 16.25, thus tasks would fire after 4pm and all the way til midnight.

Duck Redbeard

unread,
May 22, 2018, 3:58:13 PM5/22/18
to Tasker
You could automate this as a text or autoremote notification. Her device could be configured to return a message that would give you a confirmation that the message indeed made it to her device.

I once had my device set up to send a text to my wife if I arrived at my daughter's school and parked the car. If I simply drove past her school it would not fire. It used location AND the bluetooth disconnect to capture that I was parked.

Robert Yung

unread,
May 22, 2018, 7:00:56 PM5/22/18
to Tasker

On Tuesday, May 22, 2018 at 3:53:36 PM UTC-4, Duck Redbeard wrote:
Add a time context so that it only fires between certain times of the day.  Or use %TIME variable, where if %TIME>16then run your task.  My example is if the HOUR if the day is greater than 16. Since the time 4:25pm is expressed as 16.25, thus tasks would fire after 4pm and all the way til midnight.

I don't think you can use any time-related variables in a context. I guess it would be too taxing for tasker to constantly update the time variables for profiles. It should work within the a task so the task will run but then have it stop if the time is not at the right value. 

Duck Redbeard

unread,
May 22, 2018, 7:35:25 PM5/22/18
to Tasker
I have several profiles that use %TIME without any issue. Here is one that I use to enter my own Car mode…

Profile: Standing+Charging+After Work (431)
State: Orientation [ Is:Standing Up ]
State: Power [ Source:Any ]
State: Variable Value [ %Mode !~ Car ]
Time: From 1:30PM Till 3:10PM
Enter: Car docked afternoon (189)
A1: AutoInput Unlock Screen [ Configuration:Unlocking Screen.

Android 7 and above:
This will only unlock your screen if you're using a non-secure lock screen or if Smart Lock (Trusted Places, Trusted Devices, etc) is currently active.


Android 6 and below:
it's highly recommended that you use the Tasker 'System Lock' action at the end of this task. If you don't, your screen's lock will be permanently off and your system might even become unstable.

This action WILL NOT work with a secure screen lock even if you are using Smart Lock. It will only work if you have screen lock security set to none or swipe. Timeout (Seconds):10 ]
A2: Perform Task [ Name:Enable GPS Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A3: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A4: Perform Task [ Name:Connect to Crosstrek Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A5: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A6: Perform Task [ Name:Nav Home Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]

Basically when I get in my car, phone charging, while upright, not already in my car, and between 1:30 and 3:10 pm, then my gps gets turned on and Maps starts navigating to home.

Viki Malik

unread,
May 22, 2018, 7:57:58 PM5/22/18
to tas...@googlegroups.com
Hi Duck

>Add a time context so that it only fires between certain times of the day.  Or use %TIME variable, where if %TIME>16then run your task.  My example is if the HOUR if the day is greater than 16. Since the time 4:25pm is expressed as 16.25, thus tasks would fire after 4pm and all the way til midnight.


I cannot use time because her office time is very flexible they are not fixed 


Thanks 

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Duck Redbeard

unread,
May 22, 2018, 8:32:15 PM5/22/18
to Tasker
Make it a large window, like starting an hour or two after you take her and then ending much later than she would typically leave.

Are you using this in conjunction with a location profile?

Monitoring %TIME doesn't create a burden for Tasker. I believe Pent once described it as a one time logic value that changes at the beginning and end of the time period you set.

Viki Malik

unread,
May 22, 2018, 8:36:15 PM5/22/18
to tas...@googlegroups.com
Ok but wouldn't it fire when I am getting back to my home 

Viki Malik

unread,
May 22, 2018, 8:38:46 PM5/22/18
to tas...@googlegroups.com
>
Are you using this in conjunction with a location profile? 

Yes I use cell near but it runs again when I take the same route to get back to home 

Robert Yung

unread,
May 22, 2018, 10:27:47 PM5/22/18
to Tasker
On Tuesday, May 22, 2018 at 8:32:15 PM UTC-4, Duck Redbeard wrote:

Monitoring %TIME doesn't create a burden for Tasker.  I believe Pent once described it as a one time logic value that changes at the beginning and end of the time period you set.  


When I say monitor time, I mean: State > Variables > Variable Value. You will not find any time variables in the lookup and if you enter %TIME, it complain: Error: that built-in variable is not valid here.

In your example, you are picking a time range and not directly monitoring the value of %TIME.

So I'm not sure why variables like %BATT and %TIMES are not accessible from the profile state.

Rich D

unread,
May 23, 2018, 5:18:37 AM5/23/18
to Tasker Google Groups Post


Yes I use cell near but it runs again when I take the same route to get back to home 

They way I would attempt to do this is just after the cell near profile fires, 

- check to see if it is in the large time frame of pick up
- do a 'get location'  action.
- wait 30 seconds (or pr
- do another 'get location' action


Use either the lat or lon (whichever makes more sense for the direction you are traveling) one of them will either be increasing or decreasing for your direction of travel. Subtract the 2 results to find Wich direction you are heading. 

Duck Redbeard

unread,
May 23, 2018, 6:17:44 AM5/23/18
to Tasker
"
When I say monitor time, I mean: State > Variables > Variable Value. You will not find any time variables in the lookup and if you enter %TIME, it complain: Error: that built-in variable is not valid here."

Why use a State>Variable for checking %TIME when there is already a time context that is easier to set up and use?

Robert Yung

unread,
May 23, 2018, 8:12:51 AM5/23/18
to Tasker


On Wednesday, May 23, 2018 at 6:17:44 AM UTC-4, Duck Redbeard wrote:
"
When I say monitor time, I mean: State > Variables > Variable Value. You will not find any time variables in the lookup and if you enter %TIME, it complain: Error: that built-in variable is not valid here."

Why use a State>Variable for checking %TIME when there is already a time context that is easier to set up and use?


The time context is ok when you want something to always happen at the same time. In my use case, I want the task to calculate when it next runs and so I would use %TIMES (epoch seconds) in a profile: if "%TIMES > %calculated-future-time"... Also, the time context is limited to the next 24 hours where with %TIMES, I can set any arbitrary future date/time.

But my point is moot since %TIMES is not available so I have code to convert my start and end times to HH:MM so to be compatible with the time context.

Duck Redbeard

unread,
May 23, 2018, 9:03:43 AM5/23/18
to Tasker
The original post in this thread was never about a specific time, it was about a range of times.  It seems you are looking to this thread to solve a different problem.  Viki's profile was about running a task when in a certain area AND during a time that was not "morning".

If you have a profile where you want something to happen at a certain time, you CAN use a single time context in addition to a day in the future if you already know what day that is going to be.  The single time context is done by having the same value in both the "from" and "to" of the time picker.  You can even use a variable value in either or both of the "from" and "to" fields.

Robert Yung

unread,
May 23, 2018, 10:07:27 AM5/23/18
to Tasker

On Wednesday, May 23, 2018 at 9:03:43 AM UTC-4, Duck Redbeard wrote:
The original post in this thread was never about a specific time, it was about a range of times.  It seems you are looking to this thread to solve a different problem.  Viki's profile was about running a task when in a certain area AND during a time that was not "morning".

Your response to the OP mentioned 'Or use %TIME variable' and I just wanted to clarify that it can't be used in a state context as I just faced this issue. I don't actually need anything solved in this thread and am sorry to misdirect the topic. 

Viki Malik

unread,
May 23, 2018, 10:17:36 AM5/23/18
to tas...@googlegroups.com
Hi everyone

Let me rephrase my question so that everyone get a better understanding of my situation 

I drop and pick my wife to her office daily
and timing of pick and drop is not consistent, sometimes in the early morning (7am) and sometimes (1am)

Its not fixed, same is for pick up timing 

Now when I am near her office (alway on a flyover near her office) I make a call to her so that she come out of her office when I reach her office so that I don't have to wait for her 

And when I pick her up and go back from the same route wouldn't task run (on the flyover) if I use location and it will happen two times one when I drop her off and go back and second when I pick up her up and go back the same route 

Hope I clarify my situation 

Thanks 

--

Robert Yung

unread,
May 23, 2018, 10:33:58 AM5/23/18
to Tasker
Just have the location context and then set a cooldown period for the profile so it doesn't activate again for a duration (eg: 12 hours).

Duck Redbeard

unread,
May 23, 2018, 10:46:11 AM5/23/18
to Tasker
Cooldown is exactly what I was just thinking.  A cooldown period will prevent the task from running a second time during that cooldown period.

Viki Malik

unread,
May 23, 2018, 10:59:32 AM5/23/18
to tas...@googlegroups.com
>Cooldown is exactly what I was just thinking.  A cooldown period will prevent the task from running a second time during that cooldown period.


 I will try to come up with a operational task 



>They way I would attempt to do this is just after the cell near profile fires, 

- check to see if it is in the large time frame of pick up
- do a 'get location' action.
- wait 30 seconds (or pr
- do another 'get location' action


Use either the lat or lon (whichever makes more sense for the direction you are traveling) one of them will either be increasing or decreasing for your direction of travel. Subtract the 2 results to find Wich direction you are heading.


Don't you guys think this is more refined approach for dealing with this situation 
Just curious to know what you guys think 

Thanks 



Duck Redbeard

unread,
May 23, 2018, 11:23:55 AM5/23/18
to Tasker
There are dozens of ways to solve some problems with Tasker.  I actually use a "check in" step when I get to work.  That sets a variable that is checked on my way home so that a specific task will only run if had been at work.  The variable is set only if I actually turned off my car when I parked my car at work.

This is relevant because you can set your task to run only every other time you cross that bridge.  It won't run in the morning but the variable will get set.  Then the second time, Tasker would see that variable and run the task.  

Adding another thought here...some people charge their phones while driving later in the day.  How about if you add a context of charging state if you would always be charging your phone while driving to get her?

Do you have NFC on your device?  My LG G4 had its NFC antenna in a very good spot and it was easy to use NFC tags to trigger tasks.  You would simply need to assign that task to the tag and touch your phone to it to initiate the call.

Or just say "Hey, Google, call my wife" when you get to the bridge

There is a thread in this group that talks about getting your ETA to a location and sending that info via text to someone, all built into one task.  You could have that trigger when you leave to get her, she would have the ETA.  https://groups.google.com/d/topic/tasker/R8hexexzPvM  This works for me but does not include traffic.  Still working on that.  This link might be of value...https://www.youtube.com/watch?v=_SoTR0wEVE4

Pak

unread,
May 24, 2018, 11:25:43 AM5/24/18
to Tasker
Re: "Do you have NFC on your device?"

That would be my choice. NFC tags are great for firing off a task as needed where it may not always be repetitive enough to have Tasker do it or where some contexts may not be reliable to happen every time and doesn't require you to take up a spot on your home screen to activate a task that you only use once a day.

I like the GPS solution if you travel in different directions for pick up and drop off. In other words, do you come in when dropping her off NOT on the flyover, put pick her up using the flyover? Or is it a situation where you use the flyover for both picking and dropping, in which case the GPS solution won't work since you travel the same direction both times?

Viki Malik

unread,
May 25, 2018, 1:05:14 AM5/25/18
to tas...@googlegroups.com
Hi

Sorry for late posting 

>"Do you have NFC on your device?"

Unfortunately no 

>
Or is it a situation where you use the flyover for both picking and dropping


Yes I use the same route for pick and drop

Thanks 

Nihilism

unread,
May 25, 2018, 2:15:17 AM5/25/18
to Tasker
I could easily be missing something and it may not be as elegant as many other possibilities, but I'd just set a variable on the first drop off visit to her work, and on the second visit to the same location, if the variable is set, then have the phone call happen and clear the variable for the next days trips.

This would only fail on occasions when you only made one trip to her work to pick her up without having delivered her earlier in the day and that could probably be dealt with by checking whether it's after noon or some time that she's never dropped off at.

Just an idea.

Viki Malik

unread,
May 25, 2018, 2:17:14 AM5/25/18
to tas...@googlegroups.com
I was thinking on the same lines:) 

Viki Malik

unread,
May 27, 2018, 8:41:52 PM5/27/18
to tas...@googlegroups.com
Hi

I came up with this task 

Call Wife (61)
A1: Variable Add [ Name:%Countflyover Value:1 Wrap Around:0 ] 
A2: Flash [ Text:%Countflyover Long:Off ] 
A3: If [ %Countflyover > 1 ]
A4: Variable Clear [ Name:%Countflyover Pattern Matching:Off Local Variables Only:Off ] 
A5: Else 
A6: End If 
A7: If [ %Countflyover ~ 1 ]
A8: Say [ Text:Hello sir.... Do you want me to call your wife Engine:Voice:com.google.android.tts:eng-ind Stream:3 Pitch:5 Speed:4 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] 
A9: Wait [ MS:276 Seconds:1 Minutes:0 Hours:0 Days:0 ] 
A10: AutoVoice Recognize [ Configuration:Hide Dialog: true

Voice command without headset
Offline Mode: true
Command: "all" Timeout (Seconds):120 ] 
A11: If [ %avcomm ~ yes ]
A12: Call [ Number:989101978 Auto Dial:On ] 
A13: Else 
A14: End If 
A15: Else 
A16: End If 



I used cell near, day, and time profile 

Could anyone please have a look at it and give your valuable Suggestions 

Thanks 

Nihilism

unread,
May 28, 2018, 12:43:30 PM5/28/18
to Tasker
I THINK it may be backwards or I'm misreading it, but it may depend on if there's another task or when you're calling it. To me this looks like it sets %Countflyover to 1 the first time is called and then, since it's 1, it makes the phone call.

I think on your first visit to the location the %Countflyover should be clear or zero, and it increments to 1 without doing anything else except exiting the task. Then on your second visit of the day it is already at 1 and it makes the phone call and clears the variable for the next mornings trip.

PK

Viki Malik

unread,
May 28, 2018, 6:43:55 PM5/28/18
to tas...@googlegroups.com
>think on your first visit to the location the %Countflyover should be clear or zero, and it increments to 1 without doing anything else except exiting the task. Then on your second visit of the day it is already at 1 and it makes the phone call and clears the variable for the next mornings trip.

Correct. It does the same thing but I use variable 1 and 2, you can use 0 and 1 it doesn't matter 

Reply all
Reply to author
Forward
0 new messages