Jump to content

Programs running at wrong times


Recommended Posts

Have had several programs that would run only in scheduled time window for years.  Recently, some started running outside of their scheduled time parameters.  For example, a program that will turn on a light only from sunset to 11 PM same day now runs all day unless disabled.  Another runs from 10 PM to 1 AM next day, but now runs all day.   Time setting is correct in the admin console.  Have verified program conditions and settings.  All 4.7.5.

Link to comment

So I would expect that the statements of the Then branch of this program to be executed at the following situations:

1) At 10:00 PM if there has been recent motion in the Bar Rec Rm,

2) Anytime the status of the motion detector in the Bar Rec Rm switches from Off to On between 10:00 PM and 1:00 AM, and

3) Anytime the motion detector in the Bar Rec Rm detects motion (sends an On) and the Bar Rec Rm Lamp South Left is off, regardless of the time of day.

Is that what it is doing? If you only want the motion detector and lamp status conditions to be matter between 10:00 PM and 1:00 AM, they should be inside parenthesis after the AND from the schedule condition.

Link to comment

So the "and" and "or" conditions are meaningless?  The program has run for years as written correctly.  It just started ignoring the time range in the last several days.

Also it should only run st 10:00 PM if the other conditions are true.  Time is a range - not necessarily a specific time

 

Link to comment

The program is triggered on specific events based on the conditions supplied:

It will run at 10:00 PM
It will run at 1:00 AM
It will run any time the motion detector in the Bar Rec Rm changes state (from Off to On, or from On to Off)
It will run any time the motion detector in the Bar Rec Rm sends an On command (whether the state changes or not)
It will run any time the Bar Rec Rm Lamp South Left changes state (from Off to On, or from On to Off)

When the program is run, the specified condition(s) are evaulated, and if True, the Then branch is executed. If the conditions evaluate to False, then the Else branch is executed.

My statement above regarding the conditions when the Then branch will be executed are based on the order of evaluation of the ANDs and ORs. Without parenthesis to change the order of evaluation, the ANDs are evaluated first, and then the ORs. Therefore, your condition expression will be evaluated like this:

((If Current_Time => 10:00 PM AND Current_Time is < 1:00 AM) AND MotionBar_Rec_Rm_S_Status != Off) OR (MotionBar_Rec_Rm_S Sent an ON Command AND Bar_Rec_Rm_Lamp_South_Left_Status = Off)

I imagine what you want is this:

(If Current_Time => 10:00 PM AND Current_Time is < 1:00 AM) AND (MotionBar_Rec_Rm_S_Status != Off OR (MotionBar_Rec_Rm_S Sent an ON Command AND Bar_Rec_Rm_Lamp_South_Left_Status = Off))

I cannot explain why it has worked up until now. This is my understanding of how program conditions in the ISY99i and ISY994i have always work.

Link to comment
4 hours ago, GTCJ said:

So the "and" and "or" conditions are meaningless?  The program has run for years as written correctly.  It just started ignoring the time range in the last several days.

Also it should only run st 10:00 PM if the other conditions are true.  Time is a range - not necessarily a specific time

 

Thinks of Boolean logic similar to regular algebra. BEDMAS. Brackets,Exponents,Division,Multiplication,Addition,Subtraction. It is the same style of process.

If you have 4 + 3 x 5. the answer is not 60 but rather 19 because X (multiplication) has a higher order of operation than plus and gets done in that order, as noted by BEDMAS above. IOW multiplication is like having assume brackets around it, beside an addition, not left to right order as it reads.

With Boolean logic, …. brackets, then AND, then OR must be done in that order and ISY maintains that order, not top to bottom.

In your If section you have four conditions we can call A,B,C and D. You If section looks like this A and B or C and D. With the rules above A and B and D must be true at the same time but C is using an "or" and no matter what A,B, and D do, C can supercede/override  them all.
Usually written like this in some styles. AxBxD + C. This makes the precedence of operations the same as algebra's BEDMAS.

When in doubt put brackets around your statement groups, especially OR statements and ask here. There are lots of BOOLS here. :)

Totally confused yet?

Link to comment

Thank you and Goose 66 for all the help.  I still don't understand why it worked before last week, but it is no doubt another case of operator error.  I believe I have a much better understanding of this due to both of your efforts,  but I don't know to put brackets around statement groups.

Link to comment

Archived

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


×
×
  • Create New...