RM rule should run only in one mode but running in all modes

I created a rule that will turn my kitchen lights on and change the Mode to Day if the front door is unlocked only while the Mode is Away. (I.E. Let there be light when we come home.)

The text notification is mostly for confirmation that the rule is or is not working as intended. Case in point, I am finding that the rule runs ANY time the door is unlocked, regardless of the Mode at the time. What am I doing wrong?

Your rule says it should set the mode to Day, because you put that under Actions.

You want mode Away to be one of the conditions that must be met before the Action is performed. Did you do that?

I believe the fix is to put your Conditions in the Actions, not just below in the Manage or Create Conditions section.

So you would have in Actions:
If Mode is Away, Then....
Kitchen Light 1, Kitchen Light 2 On
Mode: Day
Notify Ken's... Home!"
EndIf

Here is one of my examples:

Yes.

How do I get the IF/THEN logic in actions? I haven't been able to figure that out.

Select IF (conditions) THEN option since you have multiple actions to follow

Since you already have Conditionals at the bottom in the Manage section, they should appear in this dropdown list:

Wow! That is definitely not intuitive, but I think I've got it. Thanks for the help!

So am I to understand that the conditions at the bottom are not a list of all conditions that must be met for the rule to run (this is what I initially thought), but rather a predefined list of conditions you create to use in actions in the rule?

Yes, and when you choose New Condition in the dropdown in the Action, it gets populated below so you don't have to manage a condition first at the bottom.

Then what is the purpose of the list at the bottom?

It shows you what conditions are available in the rule you're building. As your rules get more complex, you may be reusing conditions in different parts of the rule. This lets you manage conditions you don't need (because you may have changed which condition you will use or you made a mistake with the condition parameters) or add additional conditions. Much easier than having to navigate to find and specify the specific device and parameters over and over again when building your rule.

This isn't a feature you're going to use particularly in a simple rule, but when you get more proficient with building rules and they become more complex, you will understand and love this feature.

Ah! I think I understand now.

What is the best way to make an entire rule, no matter how many actions, conditional? That's what I was originally trying to do here. Modifying this particular rule based on the above advice was no problem since it only has a few actions, but I imagine it would get cumbersome to make every action conditional if you have, say, 20 actions. Is there not a way to specify that the entire rule will run if a condition is true or else it will not run?

If your first line is an IF (conditions) THEN, every action following it is within that IF--ENDIF statement so that should achieve what you are looking to do. See below the "IF Ainsleys Bedroom Door is open"; all 3 of the actions following will all run to the ENDIF.

If you use a Simple Conditional Action, then there is an IF for every individual action (and ENDIF isn't necessary). For the bottom 2 lines of "IF Ainsleys Bedroom Motion is active" & "IF Ainsleys Multi-Sensor is present", the condition only applies to that one action respectively.

I think I am answering your question but let me know.

Yes, that looks like it should do the trick. It's definitely not how I thought this would work when I woke up this morning, but I believe I understand now. Thanks for the help!

1 Like

Now that I have a better understanding of how conditions work, I want to revisit one of my earlier questions:

Creating a new rule from scratch with conditional actions shouldn't be any more difficult than creating actions that are not conditional. But now I want to modify an existing rule:

I have a virtual switch called Guest Mode that I turn on to prevent various automated actions from happening when we have guests over. I don't want all of the lights in the house to shut off when I leave if a friend or family member is at the house. So I want "Guest Mode is OFF" to be a condition. Any way to do that without deleting all of the actions and recreating them as conditional actions?

In addition to the above, I do want the guest to be able to manually activate the Goodbye automation by double tapping the front porch switch, so I would want the conditions to only apply to phone presence, but the actions should always run if the button is the trigger. That sounds, like, reeeeally complicated to me, but maybe I'm overthinking it.

With some experimenting, I found that when I go to the Actions page and I hit the drop-down box Insert Actions Before" and choose the first action in the list, I can add a conditional action to the top of the actions list. At first the remaining actions don't appear nested under the conditional action, so I didn't think this was correct, but after I saved the action and and hit Done with Actions and went back to the main page for the rule, the original actions all appeared nested under the new conditional action:

This appears to be the answer to my question of how to add a condition to an existing rule that would affect the entire rule.

QUESTION: Is it necessary to close the list of actions with END-IF? I'm not entirely clear what that is used for. Looks like this should work the way it is.

Still working on the second part in my last post above. If the "Guest Mode" virtual switch is on, I do not want these actions to run automatically based on presence, but I DO want them to run if the button called Front Porch Light is pressed.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.