Jump to content

Wait statements in program


Moshe

Recommended Posts

I am trying to create a single program that would dim lights to 50% and brighten back to 100% over a 2 day period.  Is there a cleaner method than using the wait (I would prefer times instead of hours and minutes) command.  My program is below.  As an aside it did not work, but I had on Sat, and Fri in the "if" statement. 

 

 

Thanks

 

Moshe

 

Bathrooms - [iD 0022][Parent 0006]

If
        On Fri
        From     6:30:00PM
        To      11:00:00PM (next day)
 
Then
        Set Scene 'Bathrooms' On
        Wait  4 hours and 30 minutes
        In Scene 'Bathrooms' Set 'Bathrooms / Downstairs Bathroom' 50% (On Level)
        In Scene 'Bathrooms' Set 'Bathrooms / Master Bathroom' 50% (On Level)
        Wait  8 hours and 30 minutes
        Set Scene 'Bathrooms' On
        Wait  2 hours and 30 minutes
        In Scene 'Bathrooms' Set 'Bathrooms / Downstairs Bathroom' 50% (On Level)
        In Scene 'Bathrooms' Set 'Bathrooms / Master Bathroom' 50% (On Level)
        Wait  1 hour and 30 minutes
        Set Scene 'Bathrooms' On
        Wait  3 hours
        In Scene 'Bathrooms' Set 'Bathrooms / Downstairs Bathroom' 50% (On Level)
        In Scene 'Bathrooms' Set 'Bathrooms / Master Bathroom' 50% (On Level)
 
Else
        Set Scene 'Bathrooms' Off
 

 

Link to comment

Your program sets devices in a scene to a particular level and turns the scene on, then, after waiting, sets the same devices in the same scene to the same levels. The scene will execute on Fri at 6:00PM and again at Sat at 11:00PM. There is no statement that turns the devices back to 100%.

 

What specifically are you trying to accomplish (e.g,, between sundown and sunrise, shabbos)?

Link to comment

Wait statements in a single program, or separate programs run at discrete times are the two options that come to my mind. 

 

I understand that you want a set of lights to "dim" (turn on to) 50%, then gradually (2 days?!) increase to 100%.  Your program turns the lights on to whatever level they are currently set, then sets the responder level to 50% then turns the scene on then sets the responder level to 50% (again?!) then turns the scene on then sets the responder level to 50% (again?!) then turns the scene on.  I see nothing that increases brightness levels to any value other than 50%. 

Link to comment

Thanks stusviews and oberkc -

 

This is what I am trying to do.  I would like the bathroom lights to turn on at 6:00 PM on Fri, at 100% brightness  wait a few hours and dim down to 50% brightness , again wait so many hours and brighten back to 100% and so on.  I would like the lights to react immediately after the wait time. (I am trying to configure for Shabbos and Yom Tov ultimately.)

 

Thanks

 

Moshe

Link to comment

Devices/scenes do not automatically turn on after a wait state. You have to issue a command to turn then on.

 

Set 'scene_name' on

Wait

In scene 'scene_name' set 'device_name'  50% (On Level)

Set 'scene_name' on

Wait

In scene 'scene_name' set 'device_name'  100% (On Level)

Set 'scene_name' on

 

repeat as needed. Glick B)

Link to comment

Actually, a multi-program strategy can eliminate the need to repeat the same statements:

 

Main Program

If

        whenever

 

Then

        Run Program 'dim' (Then)

        Wait

        Run Program 'bright' (Then)

        Wait

       .

       .

       .

 

 

Program Dim

        If

              - No conditions -

 

        Then

              In scene 'scene_name' set 'device_name'  50% (On Level)

             Set 'scene_name' on

 

Program Bright

       If

          - No conditions -

 

       Then

             In scene 'scene_name' set 'device_name'  100% (On Level)

             Set 'scene_name' on

Link to comment
That is what I did but it did not work.  I am not sure what I am doing wrong.

 

Are you sure that is what you did?  If you judged the outcome after 4 hours and 30 minutes, you might reach that conclusion, but you might also be wrong.  Your program, as written, would not have any affect on actual lighting levels until 13 hours (4h30m + 8h30m).  Your program will NEVER brighten back to 100% (all your statements set the levels to 50%), and I am curious which of the statements you expected to do so.

 

When you say a "few" hours, do you not have a specific time frame in mind? 

 

My temptation would be to create a couple of scenes: Bathroom50% and Bathroom100% with obvious responder level settings.  Create a program:

 

If

        On Fri

        From     6:30:00PM

        To      11:00:00PM (next day)

 

Then

        Set scene bathroom100% to ON

        Wait a few hours

        Set scene bathroom50% to ON

        Wait so many hours

        Set scene bathroom100% to ON

        and so on

else

        nothing

Link to comment

All -

 

Thanks for the help.  It seems I need to make a couple of scenes to make this work they I would like. 

 

oberkc -

 

The statement that should bring the lights back to 100%  is "  Set Scene 'Bathrooms' On" since I could not adjust the scene "bathrooms" to 50%, I added the statements. "In Scene 'Bathrooms' Set 'Bathrooms / Downstairs Bathroom' 50% (On Level)
        In Scene 'Bathrooms' Set 'Bathrooms / Master Bathroom' 50% (On Level)"

 

I thought the last two statement would bring  brightness to 50%. 

 

Concerning the wait statements:  The first wait statement of 4h30m should fire off first, dim to 50% and then after 8h30m brighten to 100%.  I am not sure why it would wait a total of 13 hours (you are correct it did wait 13 hours)

 

Thanks

 

Moshe

Link to comment

Concerning the wait statements:  The first wait statement of 4h30m should fire off first, dim to 50% and then after 8h30m brighten to 100%.

 

I think there is some confusion about the purpose of the "in scene set xxx/yyyy to 50%".  The confusion is, based on my reading of this forum, pretty common. 

 

Let's take your first "set scene" statement, that runs after 4h30m.  That statement:

 

 In Scene 'Bathrooms' Set 'Bathrooms / Downstairs Bathroom' 50% (On Level)

 

will do nothing more than change the responder ON level of a device "Downstairs Bathroom" to 50% when responding to a controller device (or scene) called "Bathrooms".  It will not actually cause the device to immediately change to 50%.  Once changed, the next time the device (it could also be an ISY scene name) "Bathrooms" is commanded to be ON, the responder device "Donwstairs Bathroom" will turn to 50% level. 

 

Remember, a scene can have many controllers and many responders, with each responder having a specific ON level (anywhere from 0 - 100%) defined for each controller.  If, for example, you have a scene called "Bathroom" that includes a device called "downstairs bathroom" where the responder level for that device defined at 50%, turning ON the scene will cause the "downstairs bathroom" device to turn to 50% (the defined ON level).  Turning ANY scene ON will cause all included device to go to the defined ON levels, unique for each controller in the scene.

 

Back to your first command after the 4:30 wait...all it did was adjust the level to which one device would turn ON if/when that scene was ever commanded to turn on (which did not happen until 8h30m after that. 

 

The statement that should bring the lights back to 100%  is "  Set Scene 'Bathrooms' On"

No.  That statement would only cause the light to turn to the defined ON level, now 50%.

 

 It seems I need to make a couple of scenes to make this work they I would like

While my initial reaction would be to think this might be the most convenient way, it is certainly not the only way.  In fact, you could use your approach, but it would require several more program lines and have, in my estimation, little benefit.

Link to comment

1. Setting a scene to an On-level does not turn the scene on. That has to be done manually, via the ISY interface or from a program, Setting the scene to an On-level only sets the level for the next time the scene is turned on.

 

2. When I create a program with 'waits,' it's not the wait I'm testing, it's the other statements. So, I usually set the wait to a few seconds during testing.

 

3. If the program has a start and/or end time, I set the time to begin in a minute or two and adjust the end time, if any, appropriately.

Link to comment

Archived

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


×
×
  • Create New...