Jump to content

Scene won't shut off after wait


pilotgeek

Recommended Posts

Posted (edited)

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
Posted (edited)

One of the conditions changes before the wait expires.

 

Sent from my SM-G955U1 using Tapatalk

Edited by Gary Funk
Posted

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

Posted

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

Posted

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

Posted

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

 

Sent from my SM-G955U1 using Tapatalk

Posted

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

Posted

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.

Posted (edited)

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
Posted

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.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.4k
×
×
  • Create New...