"any is on" vs "OR"

I'm creating a rule based on multiple switches as a trigger and had a question.

In my test code, I was using IF (Switch1 is on OR Switch2 is on) THEN do stuff. This worked no problems
I'm now going back and cleaning up the rule a bit and am now doing IF (Switch1, Switch2 any is on) THEN do stuff.

I haven't tested it yet as I'm still completing the rest of the rule, but just wanted to know before I go through and complete it all that these should operate the same, right? Any reason to use one over another? I get if you're using different types of triggers (e.g. 1 switch OR 1 contact sensor), but since they're both the same type, this was put to make our lives easier, right?

Good to know. I'll keep that in mind for future events if I want to use notifications. Thankfully for this rule, I don't need to notify anything. I'm looking to control some somfy blinds by tapping into a secondary remote via relays, so I won't need to notify of anything. If I do use it for contact sensors though, I'll look to use OR instead of any

1 Like

(Posted in response to a question--now edited, but I'll leave this here in case it's still helpful--about whether a single "any" trigger would show the specific triggering devices for %device% or just the specific device:)

This:
image
Gives this outcome when Switch 1 is turned on (similar for Switch 2 or off, etc.):

image
(bottom log entry from device, top from RM)

One area where I know multiple "OR" triggers vs. one single "any" trigger matters is with triggers like: "Switch 1, Switch 2, Switch 3 any on" compared to "Switch 1 on OR Switch 2 on OR Switch 3 on." Here, any switch changing (to any value) will match the first ("any") trigger as long as one or more of those switches is still on. The latter trigger--which I think a lot of people intend to do when they write something like the first--will trigger only on a specific switch turning on. But with conditionals inside a rule (the specific scope of this question, though both are good to know), I'm not aware of any differences.

2 Likes

I am probably confused, but I remember when Rule 4.0 came out I tried doing a battery notification rule with something like "Device1, Device2, Device3 any < 50". All of my battery devices were listed in the notification when one fell below the threshold. "Device1 <50 OR Device2 < 50 OR Device3 < 50" just gave me the single device.(But who really wants to do all that?)

It was a while ago!

Yeah, I'd definitely much rather use a purpose-built app for that!* Maybe earlier builds of RM 4.0 worked differently. With the single "any" trigger, what would definitely happen (at least now) is that you'd get a notification with one specific device name any time any device reported a battery level and one (or more) happened to be below that level, even if it wasn't the specific device that triggered the rule and even if that particular device had a level above the threshold.

*actually, I gave up on battery monitoring at all in favor of device activity :laughing: ... but I feel like at some point I'll try to add it back for devices I care about once I figure out what good thresholds might be, should any actually be reliably "good"

1 Like

Thanks for correcting me! First post deleted.

You could still be right--I'm not sure if earlier versions were different. :smiley: But I've modified my post to reflect that it's now just an example of a question that is no longer here. Hopefully it's still helpful to anyone curious!

1 Like

Thank you both for the insight. Here's to hoping this post is still relevant with future iterations of RM :joy: