Rule Machine Request: String contains in custom attribute

@bravenel Would it be possible to add this feature to RM:

When selecting a custom attribute as a condition, if that custom attribute is a string - could we add the ability for the condition to be "contains".

My use case is that I have an RM rule that schedules adding and removing a cleaner's code for the front door. As I'm sure you know, many z-wave door locks are a bit temperamental and I find that usually 1/15 times it will either fail to add or delete the code. I'd like the rule to check after the command is sent to see if the code has been set. However the lockCodes attribute is a String that contains the codes in a JSON blob. So I want to be able to see if the code I wanted to set is contained within that blob


I must not be understanding your question... because I think I do this today. It's a different application. I'm reading alarm status data from an Envisalink board in a Vista 20 panel, but the idea is the same. The custom attribute "status" is a string.


Doesn't appear to be possible:

You could put the value in a variable, and then test it with 'contains'.

1 Like

I wonder if it's something specific to the lockCodes driver? Here's an Echo Speaks device example. I have to imagine that "currentAlbum" is a string.

That is odd. @bravenel Any reason why it behaves differently?

Yeah, one is testing a custom attribute directly, and the other is putting it in a variable.

1 Like

but I don't see where in @brad5 's example he is putting it in a variable

lockCodes is probably an "enum" attribute, not a "string". That would be the difference.


Would it be possible to add contains options to enum attributes

1 Like

What device driver is this from? I'm getting strings from my lock.

Generic Z-Wave Lock

I'm getting strings from that driver too.

Ok that is very odd - I just checked again its definitely using the in built Generic Z-Wave Lock and I'm on the latest firmware on a C5

Download the Hubitat app