Comparison does not *contain*

In Rule Machine 5.1 is there a way to make a comparison that "does not contain"?

You can use a “not” for the condition where a “contains” condition is used. This will give you the equivalent to “does not contain”.

3 Likes

I was trying to use it in a trigger event and that option is not there. I guess it's only available in a conditional action.

You can do this with a Conditional Trigger. First you create the Condition, with the Not. Then use that for the Conditional Trigger, like this:

This would only trigger if the lock was unlocked with a code other than 'foo'.

Here is the Condition:

2 Likes

This just doesn't look right. I've created the condition but when I try and create a conditional trigger it wants me to also add a capability. The only capability that makes sense is using the device "weather" with a custom attribute of weather contains rain. What am I missing here? I just want the light to be set to blue if the custom attribute of weather on device "weather" does not contain "rain". My other rule is pretty simple and just checks if it does contain rain then make the light green.

Your trigger is a contradiction. Try using Weather reports *changed* ONLY IF (NOT Weather weather contains rain)

1 Like

Ok thank you. I think I have it right now.

I don't understand why this functionality is not extended to wait event
i want my sprinkles to wait for the weather event not to contain rain, we can only do wait to contain rain for custom attribute .

Any Condition can include the NOT operator, to reverse its logical sense. Wait for x contains "rain" could easily by wait for x NOT contains rain. But, using Wait for Event, this wouldn't be possible, as an event is a device event, not a Condition. So, there is Wait for Condition as well as Wait for Event. With Wait for Condition, it's still looking at the events, but testing the complete Condition upon each event. One big difference here is that if the Condition is already true, it won't wait at all, but proceed. Otherwise, the two actions are quite similar.

so let me explain again, i have some sprinkles and if it rains, i want to get ON only after is no longer raining.
So I want to use If weather contains rains, wait for event whether does NOT contain rain.
Now, the await event has "contains" but doesn't have "not contains" which makes no sense for me since it has both equal and not equal.


So here I used wait for expression which hopefully does what i want but I don't understand why I can't use wait for event unless I want the opposite