I have a blocks of code that does not seem to be functioning as I expect. I think it may be because I do not understand how "or"ing works in HAI.
I have two timers. I have a front door timer (that is started when the front door is opened or if someone presses the "guest leaving" scene and I have an expect guest timer started from a scene of the same name. Both timers turn on all the front lights. The front door timer is a 10 minute window, the expect guest timer is a 2 hour window.
I am trying to have block 76 perform the following logic:
Whenever the expect guest timer or front door timer changes to off, if both of those timers are off and its after the front lights off time then turn off the lights.
Line 77, performs essentially the same logic but says if it is before that time, then dim the front porch light to 55%.
What I am noticing is that when I press the guest leave button, the front door timer goes on for 10 minutes but when it transitions to off the lights are turning off.
Code:
76. WHEN Front Door Timer OFF
WHEN Expect Guest Timer OFF
AND IF Expect Guest Timer OFF
AND IF Front Door Timer OFF
AND IF TIME IS GREATER THAN Front Lights Off Time
OR
AND IF TIME IS LESS THAN SUNSET
THEN Outside Front OFF
77. WHEN Front Door Timer OFF
WHEN Expect Guest Timer OFF
AND IF TIME IS LESS THAN Front Lights Off Time
AND IF Expect Guest Timer OFF
AND IF Front Door Timer OFF
THEN SET LIGHTING LEVEL Front Porch Light TO 55%
I have two timers. I have a front door timer (that is started when the front door is opened or if someone presses the "guest leaving" scene and I have an expect guest timer started from a scene of the same name. Both timers turn on all the front lights. The front door timer is a 10 minute window, the expect guest timer is a 2 hour window.
I am trying to have block 76 perform the following logic:
Whenever the expect guest timer or front door timer changes to off, if both of those timers are off and its after the front lights off time then turn off the lights.
Line 77, performs essentially the same logic but says if it is before that time, then dim the front porch light to 55%.
What I am noticing is that when I press the guest leave button, the front door timer goes on for 10 minutes but when it transitions to off the lights are turning off.