Jump to content

Outside Security Lighting - on nighttime - off daytime


Mark Sanctuary

Recommended Posts

Posted

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

  • 2 months later...
Posted

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

Posted

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

Posted

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.

Posted

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.

Posted

Mark,

 

What does Run If mean?

 

With kind regards,

Michel

 

Michel,

Somewhere I have seen a post requesting the menu pull-down to have all three options so any part of the program could be tested. Is this a possible feature enhancement?

 

Run 'If'

Run 'Then'

Run 'Else'

Posted

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.

Posted
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,

Posted
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,

Posted

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.

 

Posted

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=

Posted

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.

Posted

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:

Posted

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.

Posted

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:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

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

  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.5k
×
×
  • Create New...