Virtuel rollershutter Item for alle rollershuttter

The common way is to build real rollershutter items for each real rollershutter, then put all rollershutter items in one group of type rollershutter.

Group:Rollershutter gShutter "All Shutters"
Rollershutter Shutter01 "Shutter 1 [%d %]" (gShutter) { ... }
Rollershutter Shutter02 "Shutter 2 [%d %]" (gShutter) { ... }
Rollershutter Shutter03 "Shutter 3 [%d %]" (gShutter) { ... }

If the shutters need a number for absolut positioning and can’t react on commands like UP/DOWN/STOP, you will need an additional rule:

rule "control shutter"
when
    Member of gShutter received command
then
    if(!(receivedCommand instanceof Number))
        switch receivedCommand {
            case UP : triggeringItem.sendCommand(0)
            case DOWN : triggeringItem.sendCommand(100)
            default : logWarn("shutter","Command {} not supported!",receivedCommand)
        }
    else
        logInfo("shutter","received Number {}, doing nothing!",receivedCommand)
end

This will suffice to control both each shutter as well as the whole group. Please be aware that there is no STOP command.

2 Likes