Jump to content

Scene won't shut off after wait


pilotgeek

Recommended Posts

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

Link to comment

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

Link to comment

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

Link to comment

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.

Link to comment

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

Link to comment

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

Link to comment

Archived

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


×
×
  • Create New...