Switch group with exec binding

I have a group switch in my .item file and some working item switches added to that group. But when switching the group switch, noting happens even though each item can one by one be switched successfully.

I have had a similar setup before but not using the exec-binding for the items. That setup worked.

My .item file:

Group:Switch:OR(ON, OFF) gNexa "NEXA" <socket> (gAll) mappings=[OFF="All on", ON="All off"]
Switch NEXA_0 "Outlet 0" <light> (gNexa) {exec=">[ON:/opt/scripts/outlet 0 1] >[OFF:/opt/scripts/outlet 0 0]"}
Switch NEXA_0 "Outlet 1" <light> (gNexa) {exec=">[ON:/opt/scripts/outlet 1 1] >[OFF:/opt/scripts/outlet 1 0]"}
// More switches added to group ...
Switch NEXA_0 "Outlet 8" <light> (gNexa) {exec=">[ON:/opt/scripts/outlet 8 1] >[OFF:/opt/scripts/outlet 8 0]"}

My .sitemap file:

Switch item=gNexa mappings=[OFF="All off", ON="All on"]

I don’t know if you can do a mappings on a group like that. And even if you can, I don’t think you would want to. You want your Group to be ON, or OFF. Just keep the mappings on the sitemap.

If that isn’t the cause, as a work around you can implement the behavior in a rule. Create a Switch All_Nexa switch not bound to anything and a rule triggered by Item All_Nexa received command with gNexa.members.forEach[sw|sw.sendCommand(All_Nexa.state.toString)].

1 Like

Hi, I have the same problem. Removing the mapping does not seem to solve the problem. Dit you manage to figure out a solution?

I stand in front of the same problem. Any solutions that work ?