Jump to content

odd behavior


aLf

Recommended Posts

Posted

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?

Posted

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 

Posted

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,

Posted

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

Posted

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

Posted

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

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

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
      37k
    • Total Posts
      371.4k
×
×
  • Create New...