Posted November 30, 200717 yr Help: I've got the following program which is not acting right... IF status GAR KPL H IS ON or status MBR KPL H IS ON or status APPLIANCE LINC IS ON and FROM SUNSET to 10:35PM (SAME DAY) and GARAGE CLOCK APPLIANCE LINC IS OFF THEN SET GARAGE CLOCK APPLIANCE LINC ON This seems to work during the time sunset to 10:35, but after 10:35 is shows a "TRUE" and will not turn off. I've tried anothe appliancelinc, same result. I have an inlinelinc that has an identical program and does it perfectly. It also shows "FALSE"? What am I doing wrong?
November 30, 200717 yr Use the 'Add And (...)' button to add some parentheses as follows: IF ( status GAR KPL H IS ON Or status MBR KPL H IS ON Or status APPLIANCE LINC IS ON ) and FROM SUNSET To 10:35PM (SAME DAY) and GARAGE CLOCK APPLIANCE LINC IS OFF THEN SET GARAGE CLOCK APPLIANCE LINC ON
November 30, 200717 yr Author Chris: Thanks. It works! Could you explain what the () do? Again thanks. TIm
November 30, 200717 yr The parentheses group the conditions the way you want them to be. eg. A or B or C and D and E - To be true: Either A or B must be true, or C/D/E all must be true - same as: A or B or (C and D and E) (A or B or C) and D and E - To be true: D, E, and One of A/B/C must be true,
November 30, 200717 yr Author Chris: When sunset came around today the items fired, but they flashed on and off, on and off. I had to remove the call for else. Take the Christmas lights. The program was: From sunset To 10:30PM IF Gate outlet is OFF Then Gate outlet ON ELSE Gate outlet OFF I would think that any time the gate outlet was turned on away from sunset to 10:30PM the program would turn it off. It did just that. But at sunset the gate outlet flashed on and off as the GUI showed the same. I removed the ELSE and the flashing stopped. I'll look tonihjt after 10:30 and see if, #1 it turned out and #2 if I try and turn it on, will ISY turn it out? What did I do wrong with my program? I must be missing something in the syntax. I'm still struggling with the logic of the ( ) issues as well. I'm not sure why the TRUE FALSES change with ( ). Tim
November 30, 200717 yr Author Chris: To clarify my questions on ( ), In the case I stated last night, I needed all the "or's" and all the "and's" to be TRUE, herefore, I'm not sure why the ( ) helped differentiate the call as true or false? Tim
December 1, 200717 yr Looking at your example, doesn't the state of gate determine if the program is true and therefore cause it to flip back and forth? What if you get rid of the else statement? ON PROGRAM: From sunset To 10:30PM IF Gate outlet is OFF Then Gate outlet ON ELSE do nothing OFF PROGRAM: From sunset To 10:30PM IF Gate outlet is ON Then do nothing ELSE Gate outlet OFF
December 3, 200717 yr Chris: To clarify my questions on ( ), In the case I stated last night, I needed all the "or's" and all the "and's" to be TRUE, herefore, I'm not sure why the ( ) helped differentiate the call as true or false? Tim I think you need the group of Or's to be true right? In other words at least one them being true. Otherwise in this case, you'd just use AND for every thing.
Create an account or sign in to comment