Use String variable in if statement to change Item state

This isn’t DSL syntax. What is CurrentBulbVar, it’s a string type variable right? It’s just a string, you cannot execute it.

What’s your objective here, to access an Item when you have its name in a string variable?

There might be shortcuts to what you are about, by carefulchoice of Item names

1 Like