How set profile to run if time > a time set in a variable?

488 views
Skip to first unread message

56 Kruiser

unread,
Aug 10, 2019, 8:35:49 AM8/10/19
to Tasker
I used a routine from the Tasker Wiki to set the sunset time every day. I want to run a profile if it is after sunset.

Problem is, if I use the variable option in setting up a profile, %TIME is not an available variable because there is a Time option for profiles. But there is no compare option in the Time option.

So, how can I accomplish something like: If %TIME > %SUNSET?

Somesh

unread,
Aug 10, 2019, 10:22:13 AM8/10/19
to Tasker
Try setting it as a State maybe. From %SUNSET to x time.

56 Kruiser

unread,
Aug 10, 2019, 8:26:46 PM8/10/19
to Tasker
Thanks for the suggestion. I should have given more detail.

That is exactly what I"m trying. But the global TIME variable is not in the variable list. I presume because there is a TIME selection for the profile. So with no TIME variable, I can't compare it to the SUNSET variable.

Somesh

unread,
Aug 11, 2019, 2:31:16 AM8/11/19
to Tasker
There's a Profile: New Profile > Event > Variables > Variable Set.
In that you can set the Variable as %SUNSET and Value as %TIME.
This will trigger the task once when your device time equals the %SUNSET time.

ktmom

unread,
Aug 11, 2019, 9:16:46 AM8/11/19
to Tasker
Use a TIME context for this.

In the FROM field, tap the crossed arrows icon and you will be able to enter your %SUNSET variable. Now the profile will trigger at the time of %SUNSET.

You say you want this to be a range of time so set the TO value to the range you want. It could be another variable such as %SUNRISE or a time chosen through the selector. To set to midnight, tap on the TO label which will toggle to midnight and a second tap back to an entry field. The profile will exit at the value in the TO field.

You can use the cooldown value set to a time greater than the range of time you've chosen to cause this profile to trigger only once when within the specified range. That setting is accessed by long pressing the profile name until it's highlighted, then tapping the gear icon at the top of the screen.

If you are unable to toggle to the variable entry, you may have to make sure beginner mode is off in preferences (version dependant).

You can get more information on the time context (or any context) in the three-dot menu when in the context.

Or read through the tasker user guide:
https://tasker.joaoapps.com/userguide/en/index.html

56 Kruiser

unread,
Aug 11, 2019, 9:45:20 AM8/11/19
to Tasker
ktdmom and Somesh...thanks for the guidance.

Maybe I'll get it going now. I'll post back on my success.
Reply all
Reply to author
Forward
0 new messages