Rules - Select Part of Context Variable?

Is there a way to extract part of a device name from a context variable?

Here’s the use case … I created a rule that triggers on the push of any one of 13 momentary buttons. These button devices all have names “Outdoor Scene - ‘scene name’”. I want to be able to code the Flow part of my rule with a single set variable instruction with the ‘scene name’ (so the text after the '- ') rather than 13 statements in the flow.

I could remove the 'Outdoor Scene - ’ from the device names off course but would rather not.

Yes, you can accomplish this with expressions. Today’s beta release includes a few more string functions in expression which I believe would make this easier too. :slight_smile:

Update: For anyone finding this post, check out the following help article for more details on expressions. When this was originally posted, some of the functions were only available in beta (which Nezmo is part of) and they are now available to everyone: