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.

my light keeps turning off with this program, need help

Featured Replies

Posted

So the objective of this program is to turn on the foyer light when ever I walk near the motion sensor (zone6) and only when the alarm is armed (stay_mode). The problem I have is when I turn on the foyer light manually it will simply turn off after one minute, which I don't want it to do. Can anyone point me in the right direction?

 

 

If

$Zone6 is 1

And Program 'stay_mode' is True

 

Then

Set Scene 'Foyer' On

 

Else

Wait 1 minute

Set Scene 'Foyer' Off

so what is causing the variable to change and cause the if clause to evaluate and then be false so it runs the else?

 

Alan

All changes to $Zone6 and Program 'stay_mode' trigger the Program. Most of the time the If is going to be evaluated False which results in the Wait and turning the Set Scene 'Foyer' Off. I assume these statements were put in the Else because the Set Scene 'Foyer' Off was not being executed when put in the Then clause. They don't get executed because a Wait allows the If to be reevaluated. The Program trigger condition changes to False during the Wait so the statement(s) after the Wait do not get executed.

 

Rather than put the Wait and Set Scene 'Foyer' Off in the Else, split the logic into two Programs. The first Program triggers as coded now but invokes a second Program from the first Program Then clause which has the Then clause

 

Then

Set Scene 'Foyer' On

Wait 1 minute

Set Scene 'Foyer' Off

 

This way the If in the first Program does not get revaluated because there is no Wait statement.

  • Author

Thanks Lee, I think that makes sense what do i put in the if statement of the second program?

Nothing is needed in the second Program If section.

 

If

$Zone6 is 1

And Program 'stay_mode' is True

 

Then

Run Program 2

 

Else

 

 

 

If

 

Then

Set Scene 'Foyer' On

Wait 1 minute

Set Scene 'Foyer' Off

Else

  • Author

Do I set it to Run (Then Path ) when I call it from the first program?

Does not matter. Run If is the same as Run Then in this case.

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.