RM change from or to and

Probably missing something obvious but how do I change per subject?

Triggers are always OR, as triggers are events. You can't have multiple events happen on multiple devices at the exact same time, so AND wouldn't make sense there as it would never be true. Trigger = start the logic in the action section below.

If you need to check the status of multiple sensors before running an action, that would go in the action section - something like if x AND y turn off garage lights.

3 Likes

Moreover, if you find yourself wanting an AND condition (i.e. Only between these two times, etc.), then you are likely thinking of a Required Expression (formerly known as Predicate Rule), and/or a Restriction on the rule itself.

3 Likes

In short I have a contact sensor that will turn on garage light on the door, I want light to go off when door is closed IF both motion sensors report inactive.
That way if wife closes door and I'm in garage light stays on

I'll try the "required expression" and see if that gets me sorted

PS; Thanks to both of you for the quick replies :slight_smile:

1 Like

That got it sorted! Once again thanks to you both and this great community

3 Likes

Here's my little mnemonic,

"With Predicates true,
when Triggers say do,
your Rule will then go,
unless Restrictions say no."

1 Like

Do you still want it to turn off if the door closes and then the motion sensors go inactive? If so, perhaps you have another app/rule that handles that; if you do not, you'll want to re-think this rule (or add something else) to accommodate that possibility. Otherwise, looks good!

It should be noted that Rule Machine rules don't have restrictions per se (not from version 4.x onward), at least not in the sense that lots of other built-in apps do--a "Restrictions" section in the UI with various options. But there are lots of ways to achieve not only the same outcome but pretty much any arbitrarily complex outcome you want, which is precisely why it doesn't, by using appropriate conditional actions and other tools available in RM. :smiley:

1 Like

You're so right, and I was being too lazy to double check that tidbit. Let me go back up and redact my mention of Restrictions in this particular context.

Thanks - Needed something added. Now seems to be shutting off light correctly.
I have another rule for turning on which BTW was a lot simpler :slight_smile:

1 Like

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