Jump to content

Set two scene schedules in same program


sdynak

Recommended Posts

I'm sure this is easy for most of you but after searching and trying a few different options I'm still not making progress..  :?

 

 I am looking to make 1 program with two different schedules in it.. After multiple different attempts to use "or" statements I can only seem to get the first part of the schedule to run.. Meaning the 5PM to 11:59 works fine but the 5AM to 7AM won't trigger. I tried to even use a different part of the day for testing and I just can't seem to get the 2nd schedule to run. Do I have to make 2 separate programs with their own schedule? I can do that but figure it would be best to build one so less programs overall. Please do let me know your thoughts.. There are 3 separate doors on the rear of my home I want the lights to come on during these two windows when either door is opened. Maybe I'm off completely? 

 

Thanks

Stan

 

 

 

Rear 4-Way On Dark - [iD 0022][Parent 0001]
 
If
        From     5:00:00PM
        To      11:59:00PM (same day)
     Or From     5:00:00AM
        To       7:00:00AM (same day)
    And Status  'Dining Room Slider-Opened' is On
    And Status  'Family Room Slider-Opened' is On
    And Status  'Basement French Door-Opened' is On
 
Then
        Set Scene 'Rear 4-Way' On
 
Else
   - No Actions - (To add one, press 'Action')
 
 
Link to comment

Hi Stan

I would start by using parens to contain the "or".  Start by picking "or()...." at the bottom right of the screen, and us the "Move up" button to move the open paren to the top. This will mean one of these 2 has to be true, which is what I think you mean time wise.

 

If
          (
                 From     5:00:00PM
                 To      11:59:00PM (same day)
             or From     5:00:00AM
                  To       7:00:00AM (same day)
           )
    And Status  'Dining Room Slider-Opened' is On
    And Status  'Family Room Slider-Opened' is On
    And Status  'Basement French Door-Opened' is On


Then
        Set Scene 'Rear 4-Way' On

Else
   - No Actions - (To add one, press 'Action')
A note: The "and"s in the remaining lines of the program all have to be true for the program to work... do you mean any of them - use "or", or all of them - use "and"

 

Paul
Link to comment

Thank you Paul.. the "and"s at the bottom actually work independently of each other for how I had the program last as shown here.. I thought the same thing when I first started to create it but it wasn't working at all so when I added "and" to each it did.. I can only think by not having the parens on the time somehow it worked.. 

 

 So if I correct the time with the parens then would this be the right way for the "and"s?

 

Rear 4-Way On Dark - [iD 0022][Parent 0001]
 
If
        (
             From     5:00:00PM
             To      11:59:00PM (same day)
          Or From     5:00:00AM
             To       7:00:00AM (same day)
        )
    And Status  'Dining Room Slider-Opened' is On
     Or Status  'Family Room Slider-Opened' is On
     Or Status  'Basement French Door-Opened' is On
 
Then
        Set Scene 'Rear 4-Way' On
 
Else
   - No Actions - (To add one, press 'Action')
 
Best,
Stan
Link to comment

Hey Stan

 

A little more tweaking based on that change, adding parens. 

If
        (
             From     5:00:00PM
             To      11:59:00PM (same day)
          Or From     5:00:00AM
             To       7:00:00AM (same day)
        )
    And (
          Status  'Dining Room Slider-Opened' is On
        )         
    And (
             Status  'Family Room Slider-Opened' is On
          Or Status  'Basement French Door-Opened' is On
        )
Then
        Set Scene 'Rear 4-Way' On
 
Else
   - No Actions - (To add one, press 'Action')

Let's story board what this change does, the program only runs when:

  • Its bewteen the two schedules
  • Dinning room slider is open
  • One of the Family Room Slider or the Basement French door is opened

Paul

Link to comment

Thanks Paul.. I may have confused by all the ands initially.. I do only want either door to turn the light on.

 

I believe I got the basics of it now with your explanation.. I'll try it during the normal program times and report if anything different other than success. I may have to put a parens in the last "or" statements possibly.. Either way it seems now I made the schedule change with parens it works there .. I set a different time just to test and it was working.

 

Thanks again.. I tried the parens but never changed the "and" statements so weird it worked that way.. I figured something wasn't right the second schedule would not run. Really would not have expected the "and"s to work independently though so part of what threw me off initially I figure. 

 

Best,

Stan

Link to comment

​It could also be read that what he wants is this:

 

If

(
From 5:00:00PM
To 11:59:00PM (same day)
Or From 5:00:00AM
To 7:00:00AM (same day)
)
And (
Status 'Dining Room Slider-Opened' is On
Or Status 'Family Room Slider-Opened' is On

Or Status 'Basement French Door-Opened' is On
)
Then
Set Scene 'Rear 4-Way' On

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

Link to comment

Remember that Boolean logic has an order of operations just like arithmetic rules do. (BEDMAS)

 

AND has a higher order or operations than OR does.

 

 

So when we do A or B or C and D...it is implied to be A or B or (C and D)

 

This become tougher when you do it vertically. :)

Link to comment

Remember that Boolean logic has an order of operations just like arithmetic rules do. (BEDMAS)

 

AND has a higher order or operations than OR does.

 

 

So when we do A or B or C and D...it is implied to be A or B or (C and D)

 

This become tougher when you do it vertically. :)

 

Right On! More studying to do for me .. :) So much more I want to do. 

Link to comment

Archived

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


×
×
  • Create New...