I don’t think you need a proxy Item for this.
You can solve this generically using Design Pattern: Associated Items.
Instead of relying on sending the command to a Group to close the shutters, iterate through the shutters and for each one check the associated Item (the reed sensor) before deciding to close the shutter.
gRollershutters.members.forEach[ rs |
val sensor = gRollershutterContacts.members.findFirst[ s | s.name = rs.name+"_Sensor" ]
if(sensor == null || sensor.state == CLOSED) rs.sendCommand(DOWN)
]
Then you need another Rule that triggers when the sensors you care about close. In this rule check to see if the shutter should be closed based on all your criteria (time of day, temperature, weather, etc). Since 2.3 nearing release I’ll show the 2.3 way:
rule "Close rollershutters when doors close if necessary"
when
Member of gRollershutterContacts changes to CLOSED
then
// check all your states to determine if the rollershutters should be down
if(shouldBeDown) sendCommand(triggeringItem.name.replace("_Contact",""), DOWN)
end
I purposefully check for null in the first Rule so you do not need to have a sensor for every member of gRollershutters.