fahrvergnuugen Posted January 13, 2015 Share Posted January 13, 2015 I know there are tons of examples out there of using a motion sensor to control a light, but I want to know why this simple example doesn't work... The light always turns on, but often will not turn off: IF Status 'Motion-Sensor' is On THEN WAIT 5 Minutes Set Light On WAIT 10 Minutes Set Light OFF ELSE If I change the WAIT to seconds instead of minutes, it seems to work fine. My only thought is that there is something happening with concurrent runs - in other words the motion sensor is sending another Status 'Motion-Sensor' is On before the program finishes. How does the ISY treat concurrent runs of the same program? Is the original killed and a new one started? Is the new one ignored? Do they run concurrently? Link to comment
stusviews Posted January 13, 2015 Share Posted January 13, 2015 Try Control instead of Status. Link to comment
LeeG Posted January 13, 2015 Share Posted January 13, 2015 "How does the ISY treat concurrent runs of the same program? Is the original killed and a new one started?" Yes. The Program is triggered when Motion Sensor Status changes. This terminates the current Program (which is why the lights do not turn off) and the If is evaluated again. It is likely False (need MS settings to confirm) so the Else is driven. EDIT: The termination of the current program execution occurs when the Program is in a Wait or Repeat. If there is no Wait or Repeat the running clause (Then or Else) runs to the end. Link to comment
Techman Posted January 14, 2015 Share Posted January 14, 2015 fahrvergnuugen, Split your program into two programs. The first program will trigger the 2nd program. Once triggered, the 2nd program will run its course even after the motion sensor shuts off. IF CONTROL 'Motion-Sensor' is On THEN RUN PROGRAM 2 then clause ELSE (blank) Program 2 IF (blank) THEN WAIT 5 Minutes Set Light On WAIT 10 Minutes Set Light OFF ELSE (blank) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.