I would like to use a global variable as the "time of day" (aka "certain time") in a trigger. Is this possible?
My goal is to be able to change when a "Late" mode turns off the lights. My lights to turn off are spread over 6 rules. So if I can't use a global I will have to change 6 rules if the "late" time changes.
In the "Normal" mode:
I have 6 groups of lights (one is a scene) all starting and going off at different times.
In the "Late" mode:
All 6 groups will not turn off at the Normal mode but will turn off at 1:00 AM
I would like to use a global for the "1:00 AM" time.
It seems the best way I've found is to create a Rule that sets a global when a certain TIme of day occurs. Then use this variable in my conditions.
There is not a "time" type of Global Variable. Time is a very messy thing to work with, in the best of circumstances.
A related question.:
Is it possible to use "Sunset" as a variable in a condition?
I.e. if Sunset is 6pm or earlier do this, if not do that?
Is that possible somehow?
No, this isn't directly possible per se. The way I handle this is with a special mode. For example, I have a mode called Dawn. A rule sets the mode to Dawn at 6 am. But it only does this if the time is between 5 am and Sunrise. So, in the summer when sunrise is before 6 am, Dawn mode doesn't happen. Apps can use Dawn mode to affect what they do, and what level lights are set to, and conditions could be based on it being Dawn mode.
Something similar could be done with a Dusk mode.
You could also have a rule based on the timing of Sunset. Set a variable true at sunset, false at sunrise. Then, the condition
IF(sunsetVar = true AND Time Of Day between 4:00 PM and 6:00 PM) THEN
That would be true only if sunset is before 6 pm.
Question about the second method you described.
(setting a variable to be TRUE or FALSE).
If I set that variable each and every day (at sunset), then the next day I have the value as of yesterday, is that correct?
That's why you set it at both sunrise and sunset.
It would be great if there was though. With a connector that could adjust the time on a dashboard, and the ability to compare it to the current time, or use it as a scheduled time, it would be a real asset IMO, and one of the final pieces in the jigsaw.
To work round it, I currently have a system using various GVs to convert desired event times into minutes past midnight and then check it each minute against the calculated current minutes past midnight.