rule1 on Switch1#state=1 do backlog event checksunrise=%time%; event checksunset=%time% endon on event#checksunrise<%sunrise% do backlog power1 1; ruletimer1 0 endon on event#checksunset>%sunset% do backlog power1 1; ruletimer1 0 endon
规则2:当未感应到人体时,设定Ruletime1计时时间60秒,当60秒计时结束后,继电器OFF
rule2 on switch1#state=0 do ruletimer1 60 endon on rules#timer=1 do power1 0 endon