Jump to content

Outside Security Lighting - on nighttime - off daytime


Mark Sanctuary

Recommended Posts

Here is a little schedule program for controlling your outside lighting to turn the lights on at nighttime and off in the daytime. To make sure this program works well I have added one repeat 10 seconds later.

 

If
       From    Sunset 
       To      Sunrise (next day)

Then
       Set  Scene 'Outside Security Scene' On
       Wait  10 seconds
       Set  Scene 'Outside Security Scene' On

Else
       Set  Scene 'Outside Security Scene' Off
       Wait  10 seconds
       Set  Scene 'Outside Security Scene' Off

Link to comment
  • 2 months later...

Hi,

 

I copied your code verbatim (I think), but it seems that no matter what the time of day, the result of the program is to run the 'Then' branch which turns the exterior lights on.

 

I just ran it at 1:00 pm (ISY 99i clock is set correctly). Sunrise is at 7 am and sunset is at 5 pm. Result = exterior lights on.

 

Any ideas what I'm doing wrong?

 

 

If
       From    Sunset 
       To      Sunrise (next day)

Then
       Set Scene 'Exterior Lights' On
       Wait  10 seconds
       Set Scene 'Exterior Lights' On

Else
       Set Scene 'Exterior Lights' Off
       Wait  10 seconds
       Set Scene 'Exterior Lights' Off

Link to comment

blartyo,

 

Running a program from the Program Summary tab runs the program regardless of the condition. This is mostly used to test the outcome of your program. You can also choose "Run Else" which runs the Else path.

 

With kind regards,

Michel

 

Hi,

 

I copied your code verbatim (I think), but it seems that no matter what the time of day, the result of the program is to run the 'Then' branch which turns the exterior lights on.

 

I just ran it at 1:00 pm (ISY 99i clock is set correctly). Sunrise is at 7 am and sunset is at 5 pm. Result = exterior lights on.

 

Any ideas what I'm doing wrong?

 

 

If
       From    Sunset 
       To      Sunrise (next day)

Then
       Set Scene 'Exterior Lights' On
       Wait  10 seconds
       Set Scene 'Exterior Lights' On

Else
       Set Scene 'Exterior Lights' Off
       Wait  10 seconds
       Set Scene 'Exterior Lights' Off

Link to comment

Hi Michel,

 

Perhaps it should be called 'Run Then' since it seems that is what the functionality is and it would be consistent with the 'Run Else' terminology.

 

So then a follow-up question related to 'Run at Reboot':

 

In the user guide, Run at Reboot is described as "this program runs regardless of the condition". So you are referring to the program as the 'Then' condition right? In other words, 'Run at Reboot' executes the Then condition regardless of the 'If' condition.

 

Thanks for your help as I learn how to use this great device!

 

Regards.

Link to comment

blartyo,

 

Yes, you are 100% correct:

- Run means "Run Then" regardless of the condition

- Run at Reboot means "Run Then" regardless of the condition

 

With kind regards,

Michel

 

 

 

Hi Michel,

 

Perhaps it should be called 'Run Then' since it seems that is what the functionality is and it would be consistent with the 'Run Else' terminology.

 

So then a follow-up question related to 'Run at Reboot':

 

In the user guide, Run at Reboot is described as "this program runs regardless of the condition". So you are referring to the program as the 'Then' condition right? In other words, 'Run at Reboot' executes the Then condition regardless of the 'If' condition.

 

Thanks for your help as I learn how to use this great device!

 

Regards.

Link to comment

Ok, follow up question about the above outside lighting program and the From, To command.

 

Does the From Sunset command run the 'Then' portion of the program only if it is in the 'enabled' state at the time specified?

 

For example, let's say the program has been disabled. Sunset occurs at 5 pm and then at 5:10 the program is enabled.

 

(Scenario I) Does the program then evaluate the 'If' condition and say to itself (if programs could talk):

 

"oh, it is between Sunset and Sunrise, so I will execute the 'Then' condition and turn on the Exterior Lights."

 

(Scenario II) Or, does the 'From Sunset' command act as a reminder: "Remember to turn on the Exterior Lights at Sunset". But if the program is disabled at Sunset, that reminder goes away and the program will do nothing until the next reminder comes up (Sunrise).

 

I think Scenario II is the answer and I just have to get used to the fact that the ISY programming language is a little different than other languages that use similar syntax.

 

So the program is really doing this:

 

If Current Time = Sunset, then run 'Then' commands

 

If Current Time = Sunrise, then run 'Else' commands

 

 

Thanks for helping me get this sorted out.

Link to comment
Hi Michel,

 

Perhaps it should be called 'Run Then' since it seems that is what the functionality is and it would be consistent with the 'Run Else' terminology.

 

So then a follow-up question related to 'Run at Reboot':

 

In the user guide, Run at Reboot is described as "this program runs regardless of the condition". So you are referring to the program as the 'Then' condition right? In other words, 'Run at Reboot' executes the Then condition regardless of the 'If' condition.

 

Thanks for your help as I learn how to use this great device!

 

Regards.

 

 

Hello Michel:

 

I agree with Blartyo that "Run" in the Program Summary should be changed to say "Run Then" for the sake of clarity.

 

As Mark had stated, someone had requested a "Run If" option, but I personally find it hard to think how this would be useful. After all, isn't "Enabled" the same as "Run If"? If a program is enabled, then when the conditions are met, it will run. Maybe someone can suggest when such a feature would be useful.

 

 

Best wishes,

Link to comment
Ok, follow up question about the above outside lighting program and the From, To command.

 

Does the From Sunset command run the 'Then' portion of the program only if it is in the 'enabled' state at the time specified?

 

For example, let's say the program has been disabled. Sunset occurs at 5 pm and then at 5:10 the program is enabled.

 

(Scenario I) Does the program then evaluate the 'If' condition and say to itself (if programs could talk):

 

"oh, it is between Sunset and Sunrise, so I will execute the 'Then' condition and turn on the Exterior Lights."

 

(Scenario II) Or, does the 'From Sunset' command act as a reminder: "Remember to turn on the Exterior Lights at Sunset". But if the program is disabled at Sunset, that reminder goes away and the program will do nothing until the next reminder comes up (Sunrise).

 

I think Scenario II is the answer and I just have to get used to the fact that the ISY programming language is a little different than other languages that use similar syntax.

 

So the program is really doing this:

 

If Current Time = Sunset, then run 'Then' commands

 

If Current Time = Sunrise, then run 'Else' commands

 

 

Thanks for helping me get this sorted out.

 

Hello Blartyo:

 

The time conditionals function with what I believe is a 15 minute time window. So, if Sunset is 5pm, you have a program that is set to run at Sunset, and you enable the program at 5:10pm, it should run the "then" command. The same is true for fixed time commands.

 

There was a bug in 2.4.15 that had turned off this feature. It was fixed in 2.5 and 2.6.

 

If you want a wider time window, you specify that in your program, i.e., if the time is between 5 pm and 8pm, run the "Then" statement.

 

Best wishes,

Link to comment

Now I remember. That was the idea.

 

"Frist level program (runs)" --> "Second level program (evaluates IF and runs)" ...

I second that! It would be great to be able to run a program including the 'If', but not to take away the selective run either. So we could have three possible actions:

 

   Run Program 'ThisProgram'

   Run Program 'ThisProgram' (Then Path)

   Run Program 'ThisProgram' (Else Path)

The first would run the 'If'. This seems semantically more clear to me, in that when you 'run the program' (first line), you're running the whole program, including the condition; when you run a specific part, it is clearly labeled in the other lines.

 

Link to comment

d_l,

 

The programs are automatically evaluated and, if their conditions are true, are run. You can see their status on the summary page including their state. So, Running the 'If' makes it a little confusing. Does this mean: reevaluate the conditions?

 

With kind regards,

Michel

 

What does Run If mean?

Actually this was an idea about being able to make a program evaluate the "If" conditions when run from the Summary page or when run as a nested program. See: http://forum.universal-devices.com/view ... highlight=

Link to comment

Michel, I see what you mean that the "if" conditions in programs would be constantly evaluated at all times and so wouldn't ever need to be "manually" run from the Summary page drop down list. That Summary drop down list might be renamed to "Run Then" from the current "Run" choice to be less confusing.

 

So I guess this was more about the way nested programs run or don't run.

Link to comment

Thanks to Dave for digging out the link to the other thread and to Mark for quoting the relevant post.

 

Michel, this feature would be very useful in conjunction with nested conditions/programs/folders. I think it would help with the question I have posted in this thread titled Nested Conditions in the ISY Programming forum--I wish someone could help me with that question. :oops:

Link to comment

Hello d_l,

 

Yes, they are evaluated every time there's a change in state of any device or time.

 

I have already captured the requirement to rename Run to Run Then and it should be in the next release.

 

With kind regards,

Michel

 

Michel, I see what you mean that the "if" conditions in programs would be constantly evaluated at all times and so wouldn't ever need to be "manually" run from the Summary page drop down list. That Summary drop down list might be renamed to "Run Then" from the current "Run" choice to be less confusing.

 

So I guess this was more about the way nested programs run or don't run.

Link to comment

Hello JAJ,

 

We do have a Trigger 2.0 planned which might include the nested conditions. I still don't understand why you cannot use folders and nest them:

If folder 1 is true

If folder 2 is true

If folder 3 is true

If Program is True

Run Then

Else

Run Else

Of course this does not give you nested Else but it's a start.

 

With kind regards,

Michel

 

 

 

Thanks to Dave for digging out the link to the other thread and to Mark for quoting the relevant post.

 

Michel, this feature would be very useful in conjunction with nested conditions/programs/folders. I think it would help with the question I have posted in this thread titled Nested Conditions in the ISY Programming forum--I wish someone could help me with that question. :oops:

Link to comment

Archived

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


×
×
  • Create New...