SONOS Grouping not working correctly

Hello all,

I tried now several times my rules and can’t understand why it is not working:

ITEMS:
Group grSonos

/Player/
Player pl_sonos_kitchen_control “Sonos Play:1 Küche Controller” (grSonos) {channel=“sonos:PLAY1:KU:control”}
Player pl_sonos_livingroom_control “Sonos Play:1 Wohnzimmer Controller” (grSonos) {channel=“sonos:PLAY1:WZ:control”}
Player pl_sonos_bad_control “Sonos Play:1 Bad Controller” (grSonos) {channel=“sonos:PLAY1:BZ:control”}
Player pl_sonos_sleepingroom_control “Sonos Play:1 Schlafzimmer Controller” (grSonos) {channel=“sonos:PLAY1:SZ:control”}

/URI/
String str_sonos_kitchen_playuri “Sonos Play:1 Küche URI” (grSonos) { channel=“sonos:PLAY1:KU:playuri” }
String str_sonos_livingroom_playuri “Sonos Play:1 Wohnzimmer URI” (grSonos) { channel=“sonos:PLAY1:WZ:playuri” }
String str_sonos_bad_playuri “Sonos Play:1 Bad URI” (grSonos) { channel=“sonos:PLAY1:BZ:playuri” }
String str_sonos_sleepingroom_playuri “Sonos Play:1 Schlafzimmer URI” (grSonos) { channel=“sonos:PLAY1:SZ:playuri” }

/LED/
Switch sw_sonos_kitchen_led “Sonos Play:1 Küche LED” (grSonos) { channel=“sonos:PLAY1:KU:led” }
Switch sw_sonos_livingroom_led “Sonos Play:1 Wohnzimmer LED” (grSonos) { channel=“sonos:PLAY1:WZ:led” }
Switch sw_sonos_bad_led “Sonos Play:1 Bad LED” (grSonos) { channel=“sonos:PLAY1:BZ:led” }
Switch sw_sonos_sleepingroom_led “Sonos Play:1 Schlafzimmer LED” (grSonos) { channel=“sonos:PLAY1:SZ:led” }

/Radio String/
String str_sonos_kitchen_radio “Sonos Play:1 Küche Radiosender [%s]” (grSonos) {channel=“sonos:PLAY1:KU:radio”}
String str_sonos_livingroom_radio “Sonos Play:1 Wohnzimmer Radiosender [%s]” (grSonos) {channel=“sonos:PLAY1:WZ:radio”}
String str_sonos_bad_radio “Sonos Play:1 Bad Radiosender [%s]” (grSonos) {channel=“sonos:PLAY1:BZ:radio”}
String str_sonos_sleepingroom_radio “Sonos Play:1 Schlafzimmer Radiosender [%s]” (grSonos) {channel=“sonos:PLAY1:SZ:radio”}

/Current Track String/
String str_sonos_kitchen_currenttrack “Sonos Play:1 Küche Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:KU:currenttrack”}
String str_sonos_livingroom_currenttrack “Sonos Play:1 Wohnzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:WZ:currenttrack”}
String str_sonos_bad_currenttrack “Sonos Play:1 Bad Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:BZ:currenttrack”}
String str_sonos_sleepingroom_currenttrack “Sonos Play:1 Schlafzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:SZ:currenttrack”}

/Current Artist String/
String str_sonos_kitchen_currentartist “Sonos Play:1 Küche Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:KU:currentartist”}
String str_sonos_livingroom_currentartist “Sonos Play:1 Wohnzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:WZ:currentartist”}
String str_sonos_bad_currentartist “Sonos Play:1 Bad Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:BZ:currentartist”}
String str_sonos_sleepingroom_currentartist “Sonos Play:1 Schlafzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:SZ:currentartist”}

/Coordinator/
String str_sonos_kitchen_coordinator “Sonos Play:1 Küche Coordinator [%s]” (grSonos) {channel=“sonos:PLAY1:KU:coordinator”}
String str_sonos_livingroom_coordinator “Sonos Play:1 Wohnzimmer Coordinator [%s]” (grSonos) {channel=“sonos:PLAY1:WZ:coordinator”}
String str_sonos_bad_coordinator “Sonos Play:1 Bad Coordinator [%s]” (grSonos) {channel=“sonos:PLAY1:BZ:coordinator”}
String str_sonos_sleepingroom_coordinator “Sonos Play:1 Schlafzimmer Coordinator [%s]” (grSonos) {channel=“sonos:PLAY1:SZ:coordinator”}

/Local Coordinator/
String str_sonos_kitchen_localcoordinator “Sonos Play:1 Küche Coordinator [%s]” (grSonos) {channel=“sonos:PLAY1:KU:localcoordinator”}
String str_sonos_livingroom_localcoordinator “Sonos Play:1 Wohnzimmer Coordinator [%s]” (grSonos) {channel=“sonos:PLAY1:WZ:localcoordinator”}
String str_sonos_bad_localcoordinator “Sonos Play:1 Bad Coordinator [%s]” (grSonos) {channel=“sonos:PLAY1:BZ:localcoordinator”}
String str_sonos_sleepingroom_localcoordinator “Sonos Play:1 Schlafzimmer Coordinator [%s]” (grSonos) {channel=“sonos:PLAY1:SZ:localcoordinator”}

/Current Title String/
String str_sonos_kitchen_currenttitle “Sonos Play:1 Küche Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:KU:currenttitle”}
String str_sonos_livingroom_currenttitle “Sonos Play:1 Wohnzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:WZ:currenttitle”}
String str_sonos_bad_currenttitle “Sonos Play:1 Bad Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:BZ:currenttitle”}
String str_sonos_sleepingroom_currenttitle “Sonos Play:1 Schlafzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:SZ:currenttitle”}

/Current Cover Image/
Image img_sonos_kitchen_currentalbumart “Sonos Play:1 Küche Current Cover” (grSonos) {channel=“sonos:PLAY1:KU:currentalbumart”}
Image img_sonos_livingroom_currentalbumart “Sonos Play:1 Wohnzimmer Current Cover” (grSonos) {channel=“sonos:PLAY1:WZ:currentalbumart”}
Image img_sonos_bad_currentalbumart “Sonos Play:1 Bad Current Cover” (grSonos) {channel=“sonos:PLAY1:BZ:currentalbumart”}
Image img_sonos_sleepingroom_currentalbumart “Sonos Play:1 Schlafzimmer Current Cover” (grSonos) {channel=“sonos:PLAY1:SZ:currentalbumart”}

/Current Cover Image URL/
String str_sonos_kitchen_currentalbumarturl “Sonos Play:1 Küche Current Cover URL” (grSonos) {channel=“sonos:PLAY1:KU:currentalbumarturl”}
String str_sonos_livingroom_currentalbumarturl “Sonos Play:1 Wohnzimmer Current Cover URL” (grSonos) {channel=“sonos:PLAY1:WZ:currentalbumarturl”}
String str_sonos_bad_currentalbumarturl “Sonos Play:1 Bad Current Cover URL” (grSonos) {channel=“sonos:PLAY1:BZ:currentalbumarturl”}
String str_sonos_sleepingroom_currentalbumarturl “Sonos Play:1 Schlafzimmer Current Cover URL” (grSonos) {channel=“sonos:PLAY1:SZ:currentalbumarturl”}

/Current Album/
String str_sonos_kitchen_currentalbum “Sonos Play:1 Küche Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:KU:currentalbum”}
String str_sonos_livingroom_currentalbum “Sonos Play:1 Wohnzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:WZ:currentalbum”}
String str_sonos_bad_currentalbum “Sonos Play:1 Bad Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:BZ:currentalbum”}
String str_sonos_sleepingroom_currentalbum “Sonos Play:1 Schlafzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:SZ:currentalbum”}

/Current State String/
String str_sonos_kitchen_state “Sonos Play:1 Küche Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:KU:state”}
String str_sonos_livingroom_state “Sonos Play:1 Wohnzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:WZ:state”}
String str_sonos_bad_state “Sonos Play:1 Bad Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:BZ:state”}
String str_sonos_sleepingroom_state “Sonos Play:1 Schlafzimmer Current Track [%s]” (grSonos) {channel=“sonos:PLAY1:SZ:state”}

/Standalone Switch/
Switch sw_sonos_kitchen_standalone “Sonos Play:1 Küche Standalone Schalter” (grSonos) {channel=“sonos:PLAY1:KU:standalone”}
Switch sw_sonos_livingroom_standalone “Sonos Play:1 Wohnzimmer Standalone Schalter” (grSonos) {channel=“sonos:PLAY1:WZ:standalone”}
Switch sw_sonos_bad_standalone “Sonos Play:1 Bad Standalone Schalter” (grSonos) {channel=“sonos:PLAY1:BZ:standalone”}
Switch sw_sonos_sleepingroom_standalone “Sonos Play:1 Schlafzimmer Standalone Schalter” (grSonos) {channel=“sonos:PLAY1:SZ:standalone”}

/Save Switch/
Switch sw_sonos_kitchen_save “Sonos Play:1 Küche Save Schalter” (grSonos) {channel=“sonos:PLAY1:KU:save”}
Switch sw_sonos_livingroom_save “Sonos Play:1 Wohnzimmer Save Schalter” (grSonos) {channel=“sonos:PLAY1:WZ:save”}
Switch sw_sonos_bad_save “Sonos Play:1 Bad Save Schalter” (grSonos) {channel=“sonos:PLAY1:BZ:save”}
Switch sw_sonos_sleepingroom_save “Sonos Play:1 Schlafzimmer Save Schalter” (grSonos) {channel=“sonos:PLAY1:SZ:save”}

/Restore Switch/
Switch sw_sonos_kitchen_restore “Sonos Play:1 Küche restore Schalter” (grSonos) {channel=“sonos:PLAY1:KU:restore”}
Switch sw_sonos_livingroom_restore “Sonos Play:1 Wohnzimmer restore Schalter” (grSonos) {channel=“sonos:PLAY1:WZ:restore”}
Switch sw_sonos_bad_restore “Sonos Play:1 Bad restore Schalter” (grSonos) {channel=“sonos:PLAY1:BZ:restore”}
Switch sw_sonos_sleepingroom_restore “Sonos Play:1 Schlafzimmer restore Schalter” (grSonos) {channel=“sonos:PLAY1:SZ:restore”}

/Current Zone Name String/
String str_sonos_kitchen_zonename “Sonos Play:1 Küche Zone Name [%s]” (grSonos) {channel=“sonos:PLAY1:KU:zonename”}
String str_sonos_livingroom_zonename “Sonos Play:1 Wohnzimmer Zone Name [%s]” (grSonos) {channel=“sonos:PLAY1:WZ:zonename”}
String str_sonos_bad_zonename “Sonos Play:1 Bad Zone Name [%s]” (grSonos) {channel=“sonos:PLAY1:BZ:zonename”}
String str_sonos_sleepingroom_zonename “Sonos Play:1 Schlafzimmer Zone Name [%s]” (grSonos) {channel=“sonos:PLAY1:SZ:zonename”}

/Volume Dimmer/
Dimmer dim_sonos_kitchen_volume “Sonos Play:1 Küche Volume [%.1f %%]” (grSonos) {channel=“sonos:PLAY1:KU:volume”}
Dimmer dim_sonos_livingroom_volume “Sonos Play:1 Wohnzimmer Volume [%.1f %%]” (grSonos) {channel=“sonos:PLAY1:WZ:volume”}
Dimmer dim_sonos_bad_volume “Sonos Play:1 Bad Volume [%.1f %%]” (grSonos) {channel=“sonos:PLAY1:BZ:volume”}
Dimmer dim_sonos_sleepingroom_volume “Sonos Play:1 Schlafzimmer Volume [%.1f %%]” (grSonos) {channel=“sonos:PLAY1:SZ:volume”}

/Notification Sound/
String str_sonos_kitchen_notification “Sonos Play:1 Notification” (grSonos) {channel=“sonos:PLAY1:KU:notificationsound”}
String str_sonos_livingroom_notification “Sonos Play:1 Notification” (grSonos) {channel=“sonos:PLAY1:WZ:notificationsound”}
String str_sonos_bad_notification “Sonos Play:1 Notification” (grSonos) {channel=“sonos:PLAY1:BZ:notificationsound”}
String str_sonos_sleepingroom_notification “Sonos Play:1 Notification” (grSonos) {channel=“sonos:PLAY1:SZ:notificationsound”}

/Mute Sound/
Switch sw_sonos_kitchen_mute “Sonos Play:1 Mute” (grSonos) {channel=“sonos:PLAY1:KU:mute”}
Switch sw_sonos_livingroom_mute “Sonos Play:1 Mute” (grSonos) {channel=“sonos:PLAY1:WZ:mute”}
Switch sw_sonos_bad_mute “Sonos Play:1 Mute” (grSonos) {channel=“sonos:PLAY1:BZ:mute”}
Switch sw_sonos_sleepingroom_mute “Sonos Play:1 Mute” (grSonos) {channel=“sonos:PLAY1:SZ:mute”}

/Notification Volume/
Dimmer dim_sonos_kitchen_notification_volume “Sonos Play:1 Küche Volume Not [%.1f %%]” (grSonos) {channel=“sonos:PLAY1:KU:notificationvolume”}
Dimmer dim_sonos_livingroom_notification_volume “Sonos Play:1 Wohnzimmer Volume Not[%.1f %%]” (grSonos) {channel=“sonos:PLAY1:WZ:notificationvolume”}
Dimmer dim_sonos_bad_notification_volume “Sonos Play:1 Bad Volume Not [%.1f %%]” (grSonos) {channel=“sonos:PLAY1:SZ:notificationvolume”}
Dimmer dim_sonos_sleepingroom_notification_volume “Sonos Play:1 Schlafzimmer Volume Not [%.1f %%]” (grSonos) {channel=“sonos:PLAY1:BZ:notificationvolume”}

/ADD/
String str_sonos_kitchen_add “Sonos Play:1 Küche Add” (grSonos) {channel=“sonos:PLAY1:KU:add”}
String str_sonos_livingroom_add “Sonos Play:1 Wohnzimmer Add” (grSonos) {channel=“sonos:PLAY1:WZ:add”}
String str_sonos_bad_add “Sonos Play:1 Bad Add” (grSonos) {channel=“sonos:PLAY1:SZ:add”}
String str_sonos_sleepingroom_add “Sonos Play:1 Schlafzimmer Add” (grSonos) {channel=“sonos:PLAY1:BZ:add”}

/Virtual Switches for Grouping/
Switch sw_sonos_group_livingroom_with_bad “Rule Trigger group_livingroom_with_bad”
Switch sw_sonos_group_livingroom_with_kitchen “Rule Trigger group_livingroom_with_kitchen”
Switch sw_sonos_group_livingroom_with_sleepingroom “Rule Trigger group_livingroom_with_kitchen”
Switch sw_sonos_group_kitchen_with_bad “Rule Trigger group_kitchen_with_bad”
Switch sw_sonos_group_kitchen_with_livingroom “Rule Trigger group_kitchen_with_livingroom”
Switch sw_sonos_group_kitchen_with_sleepingroom “Rule Trigger group_kitchen_with_livingroom”
Switch sw_sonos_group_bad_with_kitchen “Rule Trigger group_bad_with_kitchen”
Switch sw_sonos_group_bad_with_livingroom “Rule Trigger group_bad_with_livingroom”
Switch sw_sonos_group_bad_with_sleepingroom “Rule Trigger group_bad_with_livingroom”
Switch sw_sonos_group_sleepingroom_with_kitchen “Rule Trigger group_bad_with_kitchen”
Switch sw_sonos_group_sleepingroom_with_livingroom “Rule Trigger group_bad_with_livingroom”
Switch sw_sonos_group_sleepingroom_with_bad “Rule Trigger group_bad_with_livingroom”

Switch sw_sonos_kitchen_doorbell “Rule Trigger Kitchen Doorbell” (grSonos)
Switch sw_sonos_livingroom_doorbell “Rule Trigger Wohnzimmer Doorbell” (grSonos)
Switch sw_sonos_bad_doorbell “Rule Trigger Bad Doorbell” (grSonos)
Switch sw_sonos_sleepingroom_doorbell “Rule Trigger Schlafzimmer Doorbell” (grSonos)

RULES:

rule “Group Bad with Küche”
when
Item sw_sonos_group_bad_with_kitchen changed to ON
then
var Number v_volume = dim_sonos_bad_volume.state as DecimalType

sendCommand(sw_sonos_bad_standalone, "OFF")
sendCommand(str_sonos_bad_add, "RINCON_949F3E1B6DDA01400")

sendCommand(dim_sonos_kitchen_volume, v_volume)
sendCommand(str_sonos_kitchen_coordinator,"RINCON_7828CAA95C5201400")
sendCommand(sw_sonos_kitchen_standalone, "OFF")

sendCommand(str_sonos_bad_localcoordinator,"ON" )
sendCommand(pl_sonos_bad_control, "PLAY")

end

rule “Group Küche with Bad”
when
Item sw_sonos_group_kitchen_with_bad changed to ON
then
var Number v_volume = dim_sonos_kitchen_volume.state as DecimalType

sendCommand(sw_sonos_kitchen_standalone, "OFF")
sendCommand(str_sonos_kitchen_add, "RINCON_7828CAA95C5201400")

sendCommand(dim_sonos_bad_volume, v_volume)
sendCommand(str_sonos_bad_coordinator,"RINCON_949F3E1B6DDA01400")
sendCommand(sw_sonos_bad_standalone, "OFF")

sendCommand(pl_sonos_kitchen_control, "PLAY")

end

It’s working to group from kitchen/Küche to bad/Badezimmer, but not the other way round.

Can you see an error here?

Thanks,
Jan