In my sitemap I’m using selection, after the item bound to it gets a value I would like to use its value as an Item name, how can I do this?
Propably the answer is about the .members.filter function, but I can’t use it.
In the .Rules file I’m simply trying to find out how to use the .members.filter, it is suppose to find the sensor2 item among the Sensor members and then post update the temperature item. Even this simple rule doesn’t work
More precisely:
Item file
Group Sensor
String sensor2 “[%s]” (Sensor)
String devicet
Sitemap file
Selection item=devicet label=“Device to use” mappings=[“sensor2”=“sensor2”]
Rules file
rule "devicet"
when
Item devicet received command
then
var String mm=devicet.state.toString()
if(Sensor.members.filter(s|s.name == mm)){
postUpdate(temperature,5)
}
end
Thanks for your help, I hope I was able to describe my problem.