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.

Scene won't shut off after wait

Featured Replies

Posted

Hello,

 

I have a program that is supposed to turn on the garage lights for a few minutes after the garage door closes at night.  It turns on the lights 100% of the time, but I don't think it has ever turned them off after the wait.  The following is the program:

 

Garage Courtesy Lights - [iD 000E][Parent 0001]

If
        From    Sunset
        To      Sunrise (next day)
    And (
             Control 'Garage / Double Door' is switched On
          Or Control 'Garage / Single Door' is switched On
        )
    And Status  'Garage / Garage Side Door Switch' is Off
 
Then
        Set Scene 'Garage / Garage Lights' On
        Wait  10 minutes and 10 seconds
        Set Scene 'Garage / Garage Lights' Off
 
Else
   - No Actions - (To add one, press 'Action')
 


This is the only program that I have with a "Wait" if that matters.  Any thoughts as to what the issue is would be appreciated.

 

Regards,

Neal

Edited by pilotgeek

One of the conditions changes before the wait expires.

 

Sent from my SM-G955U1 using Tapatalk

Edited by Gary Funk

When you turn the scene on (first line of the ‘Then’), the state of the ‘Garage Door Switch’ likely changes, causing the wait to abort, the ‘If’ to re-evaluate and ‘Else’ to execute (with no terms).

Does something change the state of the garage Side Door Switch, for example, do you turn it on after leaving the garage?

  • Author

One of the conditions changes before the wait expires.

 

Sent from my SM-G955U1 using Tapatalk

Possible.  But every time?!?

  • Author

When you turn the scene on (first line of the ‘Then’), the state of the ‘Garage Door Switch’ likely changes, causing the wait to abort, the ‘If’ to re-evaluate and ‘Else’ to execute (with no terms).

OK.. that one makes a modicum of sense.  If that is the case, then how does one write that condition correctly.  In other words, I only want to do the work if the lights are off.  If turning the lights on [through the scene] then kills the wait due to the lights now being on it defeats the purpose.  What is Best Practice for this situation?

 

Regards,

Neal

An easy fix is to have the program call a second program that has the THEN statements.

 

Sent from my SM-G955U1 using Tapatalk

An easy fix is to have the program call a second program that has the THEN statements.

 

Sent from my SM-G955U1 using Tapatalk

This.

 

Putting your payload into a separate program means there are no triggers that can reset the wait. So, your program will complete, unless specifically triggered again (in which case the wait will abort and the then we start again).

If the Double Door or the Single Door is turned off or the Side Door Switch is turned on by any means (e.g., a program or manually), the yes. it will happen every time. Two programs, as suggested by Gary, is a solution.

Sunrise will also cancel the Then / Off portion.

 

If
        From    Sunset
        To      Sunrise (next day)
    And (
             Control 'Garage / Double Door' is switched On
          Or Control 'Garage / Single Door' is switched On
        )
    And Status  'Garage / Garage Side Door Switch' is Off
 
Then
        Set Scene 'Garage / Garage Lights' On
        Wait  10 minutes and 10 seconds
        Set Scene 'Garage / Garage Lights' Off
 
Else

        Wait  10 minutes and 10 seconds

        Set Scene 'Garage / Garage Lights' Off

Edited by larryllix

Why are you testing the condition of that switch anyway?  My guess is that switch device is in the scene being turned on.  If so, it is unnecessary to test if it is off.  Delete that line, because if it is already on, turning on the scene won't change anything (unless for some reason the scene sets a different on level brightness than the light may be and you wish to preserve it, in which case follow the suggestion above for two programs).

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.