Jump to content

Trouble with Program Clauses for Light Schedules


stillen_i30

Recommended Posts

Posted

So I've created several programs for my home network and most of them work.

 

The more advanced programs involve my garage door. I am trying to achieve a few things with the garage door status. I continue to have issues with some of the programs despite trying different things.

 

1.) Front coach lights are dimmed at 50% each night between 6pm-11pm with the following program

If
       From    Sunset  + 20 minutes
       To      11:00:00PM (same day)

Then
       Set 'Front Yard / Front Coach Lights' 45%

Else
       Set 'Front Yard / Front Coach Lights' Off

 

This program works fine. However, I use this as a "base" program for other programs to refer to when I want the behavior of the coach lights to be changed depending on different situations, and then revert back to this program once conditions of the special behavior programs are met and completed.

 

One such example is when the garage door is opened (garage sensor reports ON status). I want the coach lights to turn onto full brightness for 5 mins and then, if the time were between 6p-11pm, the lights would revert back to 50% (even if the garage door remained open or if it were closed).

 

If the time was not between 6pm-11pm (but it was after sunset and before sunrise), 3am for example, I want the lights to turn on full brightness (from off since the program above would not otherwise apply), wait 5 mins, then revert back to off.

 

What I currrently experience is once a garage door is opened, the coach lights stay on full brightness until they're told to shut off at 11pm or if the garage door was opened after 11pm, the coach lights stay on all night until another program I wrote tells ALL outside lights to be off after sunrise. Here is the program telling the coach lights to turn on with garage door opening:

If
       From    Sunset  + 20 minutes
       To      Sunrise + 20 minutes (next day)
   And (
            Status  'Garage / Main Garage Door Sensor' is On
         Or Status  'Garage / Small Garage Door Sensor' is On
       )

Then
       Set 'Front Yard / Front Coach Lights' On
       Wait  5 minutes 
       Run Program 'Coach Lights Night' (If)
       Run Program 'Coach Lights Night' (Then Path)
       Run Program 'Coach Lights Night' (Else Path)

Else
  - No Actions - (To add one, press 'Action')


 

I've tried different things where I will say "run program if" only or "run program then" only, and also have not used the parenthesis for "if." Nothing seems to get this to work properly. This leads into my other question of "run program" commands...if I specify only "Run program If" under "Then," will the ISY run If, Then and Else of that program or JUST If?

 

Thanks

Posted

"if I specify only "Run program If" under "Then,":

 

The Program referenced in the Run Program If will evaluate the If and either run the Then clause or the Else clause based on the True/False of the IF.

 

One possible issue with the second posted Program is the Wait 5 minutes. If the garage door is closed before the 5 minutes elapses the Program If will be reevaluated as False with the result that the Run Program is never executed.

 

The Program Summary showing Last Run Time for the Program with the Set 45% will indicate if the Program is every executed and whether the Then or Else ran by looking at the True/False state.

Posted

I agree with LeeG assessment regarding the consequences of closing the garage door prior to you five-minute period. Have you considered trying "control" versus "status" for your garage door sensor? Your question with regards to running only the "if" clause is also a good one.

 

Besides these two issues, I liked the approach you took with the programs. Keep your first program unchanged. For the second, try:

 

If
       From    Sunset  + 20 minutes
       To      Sunrise + 20 minutes (next day)
   And (
            Control 'Garage / Main Garage Door Sensor' is turned On <<          Or Control 'Garage / Small Garage Door Sensor' is turned On <<        )

Then
       Set 'Front Yard / Front Coach Lights' On
       Wait  5 minutes 
       Run Program 'Coach Lights Night' (If) <<
Else
 Set 'Front Yard / Front Coach Lights' Off <<

 

The reason I suggest the last line is to guard against the possibility if you open the garage door less than five minutes prior to "sunrise + 20". Without this last line, if the garage door would open within that five minute period, the wait would be interrupted at sunrise+20 when the program triggers an evaluation (now false) and the light would have remained on all day.

Guest
This topic is now closed to further replies.

×
×
  • Create New...