krommetje Super User
Joined: December 29 2004 Location: Netherlands
Online Status: Offline Posts: 695
|
Posted: February 04 2007 at 07:22 | IP Logged
|
|
|
I made this short macro to account for daylight savings!
The macro checks which month it currently is, when it is winter (here in europe) the Lights go on Immediatly, when it is sommertime, a new Timed Event is created 90 minutes in the future...
[code]
insert into macroheader values ('TEST-MONTH','TEST-MONTH',0,0,1);
insert into macrodetail values ('TEST-MONTH',1,38,'',0,'Case(month(today())when 1 then ph_macro("<YOUR MACRO>")when 2 then ph_macro("<YOUR MACRO>") when 3 then ph_macro("<YOUR MACRO>") when 10 then ph_macro("<YOUR MACRO>") when 11 then ph_macro("<YOUR MACRO>") when 12 then ph_macro("<YOUR MACRO>") else ph_usermessage("Checking the need for Delayed Illumination"))',0,'');
insert into macrodetail values ('TEST-MONTH',2,38,'',0,'Case(month(today())when 4 then ph_createtimedevent(0,"<YOUR MACRO>",ph_relativedatetime(today(),90))when 5 then ph_createtimedevent(0,"<YOUR MACRO>",ph_relativedatetime(today(),90)) when 6 then ph_createtimedevent(0,"<YOUR MACRO>",ph_relativedatetime(today(),90)) when 7 then ph_createtimedevent(0,"<YOUR MACRO>",ph_relativedatetime(today(),90)) when 8 then ph_createtimedevent(0,"<YOUR MACRO>",ph_relativedatetime(today(),90)) when 9 then ph_createtimedevent(0,"<YOUR MACRO>",ph_relativedatetime(today(),90)) else ph_usermessage("Wintertime: no delayed illimination"))
',0,'');
insert into macrodetail values ('TEST-MONTH',3,39,'',NULL,'',0,'');
[\code]
be sure to adapt the macro by replacing "<YOUR MACRO>" with your own macro(s)
Peter
Edited by krommetje - February 04 2007 at 07:26
|