code723
(Gerhard Wagner)
March 8, 2018, 4:03pm
1
Hy to everyone!
If my rule is triggered i want to split the string in Item scene_x and work with this string.
The x i get from the scene_selector.
rule "scene_select"
when
Item scene_selector received command
then
logInfo("Scene", 'scene_'+scene_selector.state.toString.split(';').get(0))
end
What do i have to write instead of this
'scene_'+scene_selector.state.toString.split(';').get(0)
that i can work with the Value?
Thank you!
rlkoshak
(Rich Koshak)
March 8, 2018, 5:50pm
2
You cannot access an Item like this. You have to have the actual Item object. Like I posted in the other thread, see Design Pattern: Working with Groups in Rules for how to pull an Item Object out of a Group using its name.
Correct. I don’t think you can even do that in any language except Javascript’s eval()
The other ‘hackish’ solution I could think of is making a GET REST call to the OH API