Time condition: variable for interval

229 views
Skip to first unread message

er...@bitnetix.com

unread,
Aug 5, 2016, 9:51:59 PM8/5/16
to Tasker
Would it be possible to add a variable repeat interval for the time condition?  You can already set the start and end times via variables, it would be nice if Tasker could set the "repeat every" interval to a variable as well.  This would allow triggered tasks to change how frequently they are triggered.

As an example, let's say that the timer is set to run from 00:00 through 23:59 every %interval seconds.
If %interval is not defined, then it defaults to not repeating and becomes an event that triggers at the start time.
If %interval is defined, say, 300 seconds (5 minutes) then at time 0, it triggers the task.
As the task is triggered, the timer is set to 300 seconds later.
The task sets the timer to 1800 (30 minutes)
At time 5 minutes, the task triggers again, since the interval was set before %interval was changed
As the task is triggered, the timer is set to %interval=1800 seconds later
The task sets the timer to 1800 (30 minutes) again
At time 35 minutes, the task triggers again
etc.

This would really help me out with a project where I want to dynamically alter how fast it repeats.

Message has been deleted

Ruan Ferreira

unread,
Jan 5, 2017, 9:00:44 AM1/5/17
to Tasker
Can someone please answer this, it would really help me too.

Graphic

unread,
Jan 5, 2017, 9:21:10 AM1/5/17
to Tasker
You have an option to repeat every hour(s)/minute(s), just not dynamically since you can't use a variable there.
This is a feature request.
Pent is the one to answer.
Message has been deleted

Ruan Ferreira

unread,
Jan 5, 2017, 9:44:11 AM1/5/17
to Tasker
I know there is an option for minutes/hours, just think it would be awesome to repeat variable.
Really hope this feature can be added.

Thanks

er...@bitnetix.com

unread,
Jan 5, 2017, 9:48:49 AM1/5/17
to Tasker
Yes, but that is not what I asked for. And I know it's a feature request, that's why I put it here.

Pent

unread,
Jan 5, 2017, 11:30:07 AM1/5/17
to Tasker
I'll consider, can't promise anything, there are so many feature requests.

Pent

Rich D

unread,
Jan 5, 2017, 5:54:10 PM1/5/17
to Tasker Google Groups Post


This would really help me out with a project where I want to dynamically alter how fast it repeats.



You can do this now by using the variable time context. set both start and end time to the same time (so it works like a event) then within the task figure and reset the time context variable for the next event time. 

er...@bitnetix.com

unread,
Jan 5, 2017, 6:03:10 PM1/5/17
to Tasker
True, but implementing a variable for the repeat interval is a lot easier. Plus, I would like to maintain a "nine to five" start stop without having to do weird time math to wrap around the "5" using your technique.

Rich D

unread,
Jan 5, 2017, 7:15:18 PM1/5/17
to Tasker Google Groups Post


> True, but implementing a variable for the repeat interval is a lot easier.

I agree a variable repeat would be nice however,
I am probably missing something here but I would think it would only take a few actions.

Plus, I would like to maintain a "nine to five" start stop without having to do weird time math to wrap around the "5" using your technique.

Not sure what you mean by wrap around the "5"?

I believe whatever math you use to set a variable repeat context should be just as easy to set a variable time context.

IE.. you want to repeat every 5 min you would add 5 min to the variable time context.

er...@bitnetix.com

unread,
Jan 5, 2017, 7:41:15 PM1/5/17
to Tasker
I may not have explained it well.  Let's say, from 9am-5pm, I want to have something occur at random intervals between 10-20 minutes.  RIght now, that would require a lot of math to simply have a single time event trigger that figures out its next event time.  It would be a lot easier to have a profile with a start time of 9am, end time of 5pm, and an interval time of %interval. Then the task can set %interval to random(0-10)+10 to get a 10-20 minute interval.
Message has been deleted

Abdullah Alahdal

unread,
Jan 5, 2017, 11:06:58 PM1/5/17
to Tasker
I do not think you need more than 1 action, I have similar case.
In your case you need to make 2 profiles and 2 Global variables (%EvenTime & %Interval)

Profile 1 - One context: Time: 9am to 5pm. Just make one action (Anchor) in the Enter Task.

Profile 2 - Two contexts: here you should have your task which will run every x minutes.
A- Profile State: Select Above one.
B- Time: %EvenTime to %EvenTime

At the end of task just add one Set Variable action:

%EvenTime = %TIMES+(%Interval*60)

If you want intervals in hours just change 60 to 3600 but %Interval should not be more than 24.

One more thing, for the 1st run you need to set %EvenTime manually or just make one more Task with actions to set %EvenTime and make home shortcut for this task.

I hope I was clear.

er...@bitnetix.com

unread,
Jan 5, 2017, 11:11:00 PM1/5/17
to Tasker
Yes, you were clear, but that doesnt solve my example case. At 5pm, when the profile is supposed to stop, I would have to calculate %internal with an extra 16 hours so that it "wraps around" back to 9am.

I appreciate everyone's input, and there are workarounds, but simply having a variable for the interval is a very easy solution that doesn't require multiple profiles or trigger actions or complex interval math.

Abdullah Alahdal

unread,
Jan 5, 2017, 11:35:25 PM1/5/17
to Tasker
Good!

In the 1st profile of my above suggestion, just make an Exit Task (no need for the Enter one) and insert one action.

Set Variable: Set %EvenTime to 09.00

Rich D

unread,
Jan 6, 2017, 5:06:51 AM1/6/17
to Tasker Google Groups Post

Yes, you were clear, but that doesnt solve my example case.  At 5pm, when the profile is supposed to stop, I would have to calculate %internal with an extra 16 hours so that it "wraps around" back to 9am.

I appreciate everyone's input, and there are workarounds, but simply having a variable for the interval is a very easy solution that doesn't require multiple profiles or trigger actions or complex interval math.

The simple solution would be to just make a second profile with the 9-5 context and link it to a task that just contains a stop action. Then add a state / tasker / profile active context to your variable time context profile.


The variable time context was a highly requested and long awaited feature. I believe It was a very complex feature to implement. I could not locate the post but I do remember being a bit disappointed that the  'Every' option was not a variable as well and did request it way back then. I can not recall Pents reply but it was never implemented.  My assumption is this would be a complex addition as well, and with limited  development time Pent will usually give these types of requests a lower priority if there is a simple work around. 

Reply all
Reply to author
Forward
0 new messages