Jump to content

if and or question


flemingmike

Recommended Posts

Posted

does this make sense?

 

If
       (
            Control 'Other / Krista's Keypad - G' is switched On
         Or Control 'Other / Mike's Keypad - G' is switched On
       )
   And From    Sunset  +  1 minute
       To      10:30:00PM (same day)

Then
       Run Program 'G - All Off Night' (Then Path)

Else
       Run Program 'G - All Off Day' (Then Path)


Posted

The Else will run at 10 PM and when either of the two KPL buttons are pressed On and not within the time range. If that is not the desired result put the Else Action statement in another Program that triggers specifically at 10 PM.

Posted

what i want to accomplish is if mike or kristas keypad g is pressed between sunset and 10:30pm i want the all off night program to run. if mike or kristas keypad g is pressed any other time i want the all off day program to run.

Posted

"what i want to accomplish is if mike or kristas keypad g is pressed between sunset and 10:30pm i want the all off night program to run. if mike or kristas keypad g is pressed any other time i want the all off day program to run."

 

That is what I would expect to happen. Is that not what is happening?

Posted

That is correct. A Schedule From/To causes the Program to trigger at the From time and the To time. The clause that runs is determined by the True/False of the If conditions.

 

If that is not what is needed put the Else logic in another Program in the Then clause with positive (True) is conditioning.

Posted

Try these two programs

 

 
If
       (
            Control 'Other / Krista's Keypad - G' is switched On
         Or Control 'Other / Mike's Keypad - G' is switched On
       )
   And From    Sunset  +  1 minute
       To      10:30:00PM (same day)

Then
       Run Program 'G - All Off Night' (Then Path)

Else
       - -blank


If
       (
            Control 'Other / Krista's Keypad - G' is switched On
         Or Control 'Other / Mike's Keypad - G' is switched On
       )
   And From    10:30:01PM 
       To        Sunset  +  59 seconds (next day)

Then
       Run Program 'G - All Off Day(Then Path)

Else
       - -blank



Posted

I think I, too, would break this into two programs:

 

If
                    Control 'Other / Krista's Keypad - G' is switched On
         Or Control 'Other / Mike's Keypad - G' is switched On

Then
       Run Program 'time' (if Path)

Else

 

time program

 

If
       Time is from    Sunset  
       To      10:30:00PM (same day)

Then
       Run Program 'G - All Off Night' (Then Path)

Else
       Run Program 'G - All Off Day' (Then Path)

 

The time program must be disabled.

Guest
This topic is now closed to further replies.

×
×
  • Create New...