Hi everyone, sorry if this has been asked before, but I searched the forum, and can't find anything. I would like to turn on some outdoor lights on with a PIR, but only at night time. i have tried the following code, but it does not work; once GetEnableState("Outside Entry PIR") = ON and (Time > SunSet) and (Time < SunRise) then begin SetLightingState("Outside Entry", ON); SetLightingState("Driveway Lights", ON); end; once GetEnableState("Outside Entry PIR") = Off then begin SetLightingState("Outside Entry", OFF); SetLightingState("Driveway Lights", OFF); end; I am guessing, from what i have read here, is as the PAC calculates the sunrise and sunset time once per day, the sunrise time is for that days sunrise, not the next. (Hope that make sence:confused: ) i also know that there is a light setting on the PIR, but it is under a roof line, so it is always dark there, so I can use it. Is there any way that I can make the lights only turn on at night? Thanks, Mark