Jump to content

Motion Sensor + Light, light not turning off


fahrvergnuugen

Recommended Posts

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

"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

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

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...