Hi Mike
sorry for awakening this very old post.
After below post by you, my suggestion ended up in the Wiki, and some time later was even improved. I even copied back the improved version
I assume you were involved in this.
However, recently I came up with a completely different method to so this.
It is based on the new %timerN% variables, and has the advantage after you make the rule, you can set and change the times in the Web-UI, for less savvy users
I was wondering if it should also end up in the Wiki, maybe even replace the %mem% based one.
But I have no idea on how and who decides what to put in the documentation
BTW: I also have a version that even works for high up north, in the lands of sunsets past midnight, or even permanent daylight and permanent nighttime.
But that is a little bit more advanced. Below the simple one, works for all cases where midnight is not passed
##################################
# New generation of sun timer, using the new %timerN% variables
#
# Program the schedule timers to turn off/on with the correct time or sun.
# Odd timers 1,3 interpreted by the rules as ON, even timers 2,4 are OFF
# Example times:
# Timer1 ON at 06h00 (unless if past timer 2)
# Timer2 OFF at SunUp (always)
# Timer3 ON at SunDown (unless if past timer 4)
# Timer4 OFF at 23h00 (always)
Timers 1
Timer1 {"Enable":1,"Mode":0,"Time":"06:00","Window":0,"Days":"1111111","Repeat":1,"Output":2,"Action":3}
Timer2 {"Enable":1,"Mode":1,"Time":"00:00","Window":0,"Days":"1111111","Repeat":1,"Output":2,"Action":3}
Timer3 {"Enable":1,"Mode":2,"Time":"00:00","Window":0,"Days":"1111111","Repeat":1,"Output":2,"Action":3}
Timer4 {"Enable":1,"Mode":0,"Time":"23:00","Window":0,"Days":"1111111","Repeat":1,"Output":2,"Action":3}
Rule1
ON Time#Initialized DO event checktime=%time% ENDON
ON Clock#Timer DO event checktime=%time% ENDON
ON event#checktime DO %var10% 0 ENDON
ON event#checktime>=%timer1% DO var10 1 ENDON
ON event#checktime>=%timer2% DO var10 0 ENDON
ON event#checktime>=%timer3% DO var10 1 ENDON
ON event#checktime>=%timer4% DO var10 0 ENDON
ON event#checktime DO Power1 %var10% ENDON
ON event#debug DO Backlog var10; var10 %timer1%; var10 %timer2%; var10 %timer3%; var10 %timer4%; var10 %var10%; ENDON
Rule1 1