Issacsim Posted March 18, 2013 Posted March 18, 2013 I have a program that turns on a light based on motion from sunset to sunrise. The program needs to wait 2 minutes before turning off the light. The lights turns on correctly, but does not turn off 2 minutes later. This is my first program using Wait statement, so I am not sure what I am doing wrong, or if I should use something else than the wait command. I am on version 4.0.2 If Status 'OutSide / FrontMotion / FrontMotion-Sensor' is On And From Sunset - 15 minutes To Sunrise + 5 minutes (next day) And Status 'OutSide / Front-Center' is Off Then Set 'OutSide / Front-Center' On Wait 2 minutes Set 'OutSide / Front-Center' Off Else - No Actions - (To add one, press 'Action')
bsobel Posted March 18, 2013 Posted March 18, 2013 The IF part of your command get re-evaluated during the WAIT command, and on the second eval it's false so the wait cancels and nothing else runs past that. If you want to use the logic as is, have your then run a second program that does the light on/wait/off (with no conditions on the IF). The use of the second program ensures their is nothing to re-evaluate to cause the wait to not complete.
Issacsim Posted March 18, 2013 Author Posted March 18, 2013 Thank bsobel Makes sense, thanks! It works fine now.
Recommended Posts