sendCommand to a filtered group

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)]

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

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 :slight_smile:

That is maybe (99% sure) true. Was only an option :slight_smile: