Help converting group based xtend rule to JSR233 please

I was making more of a general statement. For this rule, I think you will be fine, but I wanted to mention it in case you ran into trouble further on and for others reading through this topic. To be safe, convert your state to a string. You could use Rich’s suggestion or you could use the string conversion that you’re used to in the rules DSL (just remember to use the parens)…

events.sendCommand(lightingItem, items[lightingPresetName].toString())

https://www.openhab.org/docs/configuration/jsr223.html#events-operations

:+1:

@higgers, in case you haven’t seen it yet, check out this topic…

There are more details in GH. It’s similar to what you were implementing, but with more bells and whistles!