Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Motion Sensor + Light, light not turning off

Featured Replies

Posted

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?

Try Control instead of Status.

"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.

Edited by LeeG

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)

 

Edited by Techman

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.