As described under Triggers, Triggers are first preceded by IF and Conditions are always preceded by AND IF.
Now that simple triggers (IF) and conditions (AND IF) have been covered, there is a third option the secondary trigger (OR IF). I think this one confuses a lot of users until they get the concept. If you remember IF or OR IF always means it is a Trigger. AND IF always means it is a Condition. The easiest way to cover this is to go step by step.
When you first start creating an event, the first element is ALWAYS a trigger and therefore will always begin with "IF". As we've covered before a trigger is the element that gets the gets the event started, The best triggers are always a "moment in time", that will occur only once such as specific time of day or a device such as a switch or motion detector changing value. These trigger items are placed in the event queue and will be processed when the definition of the trigger is true.
Below is a simple trigger "If the time is 12:00AM".

Now if you press the add button
to the right of the trigger line, you will be presented with a new line, presumably for a condition. But you will note that there are two choices, the first being "AND IF", which is always a condition. The second choice is "OR IF" which will always represent an additional trigger.

If you choose "AND IF" you you will be given choices of conditions that will apply to the trigger, which will further refine the elements that need to be TRUE in order for an event to perform its assigned action(s). You will note that the condition immediately follows the trigger, with no space between the two lines.

On the other hand if you choose "OR IF" you will get the first clue that something is different because HomeSeer will add some gray space between the "IF" trigger and the second "OR IF" trigger.

If you choose the second trigger and collapse the line, you see two separate elements. This is a very important visual clue to a very important distinction relating to secondary or additional triggers.

Below there have been conditions added to each of the two triggers. Again, by the way they are grouped, you should be able to visualize how they are evaluated by HomeSeer's Event Engine. Here we will cause an Action to be executed At Midnight on Weekend Days or at 11:00 PM on Weekdays

Below we have created an event consisting of five different triggers and a condition for each one. This event will turn a light on at 6:00 PM on Monday, an hour later on Tuesday, an hour later on Wednesday and so on. The condition under each trigger (IF-OR IF) applies only to the trigger at the top of the group the condition is in. One group has absolutely no bearing on any other group in the event. If any one of the groups are true, the Event will run and execute the Action(s) of the Event. If none of them are true the Event will not run.

Below we have added an additional condition to each group to check if the light is actually OFF before the Action is allowed to turn it on. The reason the condition had to be added to each group is that conditions are limited in their scope to the trigger immediately above them. If you want a condition to be applied to all triggers, it must be added to each individually or included in group conditions. A statement of group conditions still must follow each trigger to which they apply, so the benefit is only realized when there are two or more group conditions applying to each trigger. More about that in another thread.

So, looking at how they are grouped and understanding that there can be only one Action or set of actions, the simplest way to look at the OR IF is that it is a means of creating a number of individual events which share a common Action or set of Actions.

The logic is simple and straight forward and really adds to the power of HomeSeer, but it is imperative that as you are designing an event you realize that the multiple trigger/condition groups within an event, have absolutely NO bearing on one another, they simply share Action(s). It is NOT an IF, THEN, ELSE logic, there is no ELSE. It is simply an IF, OR IF, OR IF logic. Sometimes for the sake of tracing event triggers within the log, it makes much more sense to create five complete events as opposed a single one with 5 triggers. You have to make that choice.
Now that simple triggers (IF) and conditions (AND IF) have been covered, there is a third option the secondary trigger (OR IF). I think this one confuses a lot of users until they get the concept. If you remember IF or OR IF always means it is a Trigger. AND IF always means it is a Condition. The easiest way to cover this is to go step by step.
When you first start creating an event, the first element is ALWAYS a trigger and therefore will always begin with "IF". As we've covered before a trigger is the element that gets the gets the event started, The best triggers are always a "moment in time", that will occur only once such as specific time of day or a device such as a switch or motion detector changing value. These trigger items are placed in the event queue and will be processed when the definition of the trigger is true.
Below is a simple trigger "If the time is 12:00AM".

Now if you press the add button


If you choose "AND IF" you you will be given choices of conditions that will apply to the trigger, which will further refine the elements that need to be TRUE in order for an event to perform its assigned action(s). You will note that the condition immediately follows the trigger, with no space between the two lines.

On the other hand if you choose "OR IF" you will get the first clue that something is different because HomeSeer will add some gray space between the "IF" trigger and the second "OR IF" trigger.

If you choose the second trigger and collapse the line, you see two separate elements. This is a very important visual clue to a very important distinction relating to secondary or additional triggers.

Below there have been conditions added to each of the two triggers. Again, by the way they are grouped, you should be able to visualize how they are evaluated by HomeSeer's Event Engine. Here we will cause an Action to be executed At Midnight on Weekend Days or at 11:00 PM on Weekdays

Below we have created an event consisting of five different triggers and a condition for each one. This event will turn a light on at 6:00 PM on Monday, an hour later on Tuesday, an hour later on Wednesday and so on. The condition under each trigger (IF-OR IF) applies only to the trigger at the top of the group the condition is in. One group has absolutely no bearing on any other group in the event. If any one of the groups are true, the Event will run and execute the Action(s) of the Event. If none of them are true the Event will not run.

Below we have added an additional condition to each group to check if the light is actually OFF before the Action is allowed to turn it on. The reason the condition had to be added to each group is that conditions are limited in their scope to the trigger immediately above them. If you want a condition to be applied to all triggers, it must be added to each individually or included in group conditions. A statement of group conditions still must follow each trigger to which they apply, so the benefit is only realized when there are two or more group conditions applying to each trigger. More about that in another thread.

So, looking at how they are grouped and understanding that there can be only one Action or set of actions, the simplest way to look at the OR IF is that it is a means of creating a number of individual events which share a common Action or set of Actions.

The logic is simple and straight forward and really adds to the power of HomeSeer, but it is imperative that as you are designing an event you realize that the multiple trigger/condition groups within an event, have absolutely NO bearing on one another, they simply share Action(s). It is NOT an IF, THEN, ELSE logic, there is no ELSE. It is simply an IF, OR IF, OR IF logic. Sometimes for the sake of tracing event triggers within the log, it makes much more sense to create five complete events as opposed a single one with 5 triggers. You have to make that choice.
Comment