Simple Regex for Node Red Help!

Hello,

i have
input_boolean.sleep_mode_livingroom_real
input_boolean.sleep_mode_livingroom_proxy

how to make a regex to use this variable “input_boolean.sleep_mode_livingroom_” ONLY with “real” or “proxy” at the end.
Will be used with current state node if it matters.

Thanks a lot!

The entity names I don’t think can be used as variables like that. To be clear, you have a total of 4 possible states based on 2 booleans (00, 11, 01, and 10), but then it sounds like you may only need a binary output… something like either “real” or “proxy”?

What is the actual application of this… are the 2 booleans really needed, or would a customized binary_sensor work for you (ie, on = real, off=proxy)?

In the end, does your node-red automations in question only have to respond to those 2 booleans (ie 4 possible states to handle differently)?

^input_boolean.sleep_mode_livingroom_(real|proxy)$

1 Like

Thanks a lot!
Must it be used this way, am i right?

Seems not to work, i get no output…

It worked fine here. How are you testing it? What are you trying to achieve with this?

I make a click on each button and get no output.
I would like that node react only on this two vars and no others.

How does your flow look like?

Sorry, it was my fault, it works fine as you wrote it!
Thanks a lot one more time! :wave: