sloth0815
(Jonas Böhringer)
August 16, 2017, 11:02am
1
This is likely trivial. I have a group with all rollershutters
Group gShutters
and would like to close only those that are not closed already. So I filter the group based on the state
WindowsEast.members.filter[s|s.state != 100]
How to I now send the command “DOWN” to the members of the group that meet the above condition?
Many thanks,
Jonas
WindowsEast.members.filter[s|s.state != 100].forEach[s|s.sendCommand(DOWN)]
Dibbler42
(Thomas Bail)
August 16, 2017, 12:55pm
3
another solution is to create a dynaic group with the filtered items and then use the send command on the griup. With Udos solution you iterate trough each item and give a send command.
Thomas
sloth0815
(Jonas Böhringer)
August 16, 2017, 1:05pm
4
Thanks, that was fast. My rule is working now.
I guess the dynamic group would also (internally) iterating through all members and do a sendCommand
Dibbler42
(Thomas Bail)
August 16, 2017, 8:42pm
6
That is maybe (99% sure) true. Was only an option