Sonos Player

Can you share some screenshot that shows the error. For me it is not clear what your issue is at the moment. The sonos rule contains so many parts that i need some more details what in detail your error is.

Can you sen commands to the Sonos_Multiroom_Control string and then the musik starts in the related rooms? If yes at least the basic config is doen and we can work on the other stuff.

If possible also share the YAML configuration of your widget.

Hello @buschif4,

Thank You for your help. When I select the room from the list through your widget, to add it to the player/group there appears no hook in the checkbox on the left side beside the room name.

log adding Küche to Schlafzimmer:

==> /var/log/openhab/openhab.log <==

2021-01-10 18:13:44.156 [INFO ] [org.openhab.rule.Sonos ] - Multiroom rule started.

==> /var/log/openhab/events.log <==

2021-01-10 18:13:44.160 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘SonosPlay3Schlafzimmer_Hinzufugen’ received command RINCON_000E5879AFA201400

2021-01-10 18:13:44.161 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘SonosPlay3Schlafzimmer_Hinzufugen’ predicted to become RINCON_000E5879AFA201400

but Küche is not checked in the List:

Here a picture from you with checked checkboxes:

The second Problem is, that I can not control the volume of alle group memebers by clicking on the volume label. It seems something should appear because the widget is blocked (I have to click a second time) but nothing happens.

Yaml Schlafzimmer (Play3):

component: widget:widget_Sonos_Player
config:
propWidgetTitle: Schlafzimmer
itemTitle: SonosPlay3Schlafzimmer_Titel
itemAlbum: SonosPlay3Schlafzimmer_Album
itemArtist: SonosPlay3Schlafzimmer_Kunstler
itemCover: SonosPlay3Schlafzimmer_Coverbild
itemPlayer: SonosPlay3Schlafzimmer_Fernbedienung
itemVolume: SonosPlay3Schlafzimmer_ZoneVolume
itemShuffle: SonosPlay3Schlafzimmer_Shuffle
itemRepeat: SonosPlay3Schlafzimmer_Wiederholen
propZoneName: Schlafzimmer
itemCoordinator: Group_Sonos_Coordinators
propZoneArray: ‘[“Schlafzimmer”; “SonosPlay3Schlafzimmer_Fernbedienung”;
“SonosPlay3Schlafzimmer_Lautstarke”;
“SonosPlay3Schlafzimmer_Master”][“Wohnzimmer”;
“SonosPlaybarWohnzimmer_Fernbedienung”; “SonosPlaybarWohnzimmer_Lautstarke”;
“SonosPlaybarWohnzimmer_Master”][“Küche”; “SonosMoveKuche_Fernbedienung”;
“SonosMoveKuche_Lautstarke”; “SonosMoveKuche_Master”]’
itemSonosRule: Sonos_Multiroom_Control

Yaml Wohnzimmer:

component: widget:widget_Sonos_Player
config:
propWidgetTitle: Wohnzimmer
itemTitle: SonosPlaybarWohnzimmer_Titel
itemAlbum: SonosPlaybarWohnzimmer_Album
itemArtist: SonosPlaybarWohnzimmer_Kunstler
itemCover: SonosPlaybarWohnzimmer_Coverbild
itemPlayer: SonosPlaybarWohnzimmer_Fernbedienung
itemVolume: SonosPlaybarWohnzimmer_ZoneVolume
itemShuffle: SonosPlaybarWohnzimmer_Shuffle
itemRepeat: SonosPlaybarWohnzimmer_Wiederholen
propZoneName: Wohnzimmer
itemCoordinator: Group_Sonos_Coordinators
itemSonosRule: Sonos_Multiroom_Control
propZoneArray: ‘[“Schlafzimmer”; “SonosPlay3Schlafzimmer_Fernbedienung”;
“SonosPlay3Schlafzimmer_Lautstarke”;
“SonosPlay3Schlafzimmer_Master”][“Wohnzimmer”;
“SonosPlaybarWohnzimmer_Fernbedienung”; “SonosPlaybarWohnzimmer_Lautstarke”;
“SonosPlaybarWohnzimmer_Master”][“Küche”; “SonosMoveKuche_Fernbedienung”;
“SonosMoveKuche_Lautstarke”; “SonosMoveKuche_Master”]’

Yaml Küche:

component: widget:widget_Sonos_Player
config:
propWidgetTitle: Küche
itemTitle: SonosMoveKuche_Titel
itemAlbum: SonosMoveKuche_Album
itemArtist: SonosMoveKuche_Kunstler
itemCover: SonosMoveKuche_Coverbild
itemPlayer: SonosMoveKuche_Fernbedienung
itemVolume: SonosMoveKuche_ZoneVolume
itemShuffle: SonosMoveKuche_Shuffle
itemRepeat: SonosMoveKuche_Wiederholen
propZoneName: Küche
itemCoordinator: Group_Sonos_Coordinators
propZoneArray: ‘[“Schlafzimmer”; “SonosPlay3Schlafzimmer_Fernbedienung”;
“SonosPlay3Schlafzimmer_Lautstarke”;
“SonosPlay3Schlafzimmer_Master”][“Wohnzimmer”;
“SonosPlaybarWohnzimmer_Fernbedienung”; “SonosPlaybarWohnzimmer_Lautstarke”;
“SonosPlaybarWohnzimmer_Master”][“Küche”; “SonosMoveKuche_Fernbedienung”;
“SonosMoveKuche_Lautstarke”; “SonosMoveKuche_Master”]’
itemSonosRule: Sonos_Multiroom_Control

Thank you again for your effort and help!

@johannesbonn ok now the issue is clear for me.

The checkbox indicates if both players are in the same group or not. Therefore it compares the coordinator channel of this device from the propZoneArray and the itemCoordinator. In your case you used the Group_Sonos_Coordinators as itemCoordinator in the widget YAML. This is wrong, you need to use the item itself. So e.g. on “Schlafzimmer” use as itemCoordinator SonosPlay3Schlafzimmer_Master

Thank you what a dump failure…sorry!

Now the item Coordinator is changed to the item _Master in every widget (SonosPlay3Schlafzimmer_Master for the Schlafzimmer widget, SonosPlaybarWohnzimmer_Master for the Wohnzimmer widget, SonosMoveKuche_Master for the Küche widget). I can group he players with checked checkboxes and I can control the volume.

But now I have the problem, that in every room the zone Schlafzimmer ist prechecked in the list and following to that the speaker “Schlafzimmer” is in every group. I think I haven’t understand the concept of grouping… Please can you explain that to me. What is my failure?

@buschif4 thanks for your reply. Here you can see the YAML config:

config:
  label: pSonosTest2
blocks:
  - component: oh-block
    config: {}
    slots:
      default:
        - component: oh-grid-row
          config: {}
          slots:
            default:
              - component: oh-grid-col
                config: {}
                slots:
                  default:
                    - component: widget:widget_Sonos_Player
                      config:
                        propWidgetTitle: Sonos Küche
                        propZoneArray: '["Esszimmer", "SonosPlay1Esszimmer_control",
                          "SonosPlay1Esszimmer_volume",
                          "SonosPlay1Esszimmer_coordinator"] ["Küche",
                          "SonosPlay1Kuche_control", "SonosPlay1Kuche_volume",
                          "SonosPlay1Kuche_coordinator"] ["Terrasse",
                          "SonosPlay1Terrasse_control",
                          "SonosPlay1Terrasse_volume",
                          "SonosPlay1Terrasse_coordinator"] ["Wohnzimmer",
                          "SonosPlay1Wohnzimmer_control",
                          "SonosPlay1Wohnzimmer_volume",
                          "SonosPlay1Wohnzimmer_coordinator"] ["Büro",
                          "SonosPlay5Buro_control", "SonosPlay5Buro_volume",
                          "SonosPlay5Buro_coordinator"] ["Moritz",
                          "SonosSYMFONISKMoritz_control",
                          "SonosSYMFONISKMoritz_volume",
                          "SonosSYMFONISKMoritz_coordinator"] ["Paula",
                          "SonosSYMFONISKPaula_control",
                          "SonosSYMFONISKPaula_volume",
                          "SonosSYMFONISKPaula_coordinator"]'
                        itemCoordinator: SonosPlay1Kuche_coordinator
                        itemTitle: SonosPlay1Kuche_Titel
                        itemAlbum: SonosPlay1Kuche_Album
                        itemArtist: SonosPlay1Kuche_Kunstler
                        itemCover: SonosPlay1Kuche_Coverbild
                        itemPlayer: SonosPlay1Kuche_control
                        itemVolume: SonosPlay1Kuche_ZoneVolume
                        itemSonosRule: Sonos_Multiroom_Control
                        propZoneName: Küche
              - component: oh-grid-col
                config: {}
                    slots:
              default:
                - component: widget:widget_Sonos_Player
                  config:
                    propWidgetTitle: Sonos Esszimmer
                    itemTitle: SonosPlay1Esszimmer_Titel
                    itemAlbum: SonosPlay1Esszimmer_Album
                    itemArtist: SonosPlay1Esszimmer_Kunstler
                    itemCover: SonosPlay1Esszimmer_Coverbild
                    itemPlayer: SonosPlay1Esszimmer_Fernbedienung
                    itemVolume: SonosPlay1Esszimmer_ZoneVolume
                    propZoneName: Esszimmer
                    itemCoordinator: SonosPlay1Esszimmer_coordinator
                    itemSonosRule: Sonos_Multiroom_Control
                    propZoneArray: '["Esszimmer", "SonosPlay1Esszimmer_control",
                      "SonosPlay1Esszimmer_volume",
                      "SonosPlay1Esszimmer_coordinator"] ["Küche",
                      "SonosPlay1Kuche_control", "SonosPlay1Kuche_volume",
                      "SonosPlay1Kuche_coordinator"] ["Terrasse",
                      "SonosPlay1Terrasse_control",
                      "SonosPlay1Terrasse_volume",
                      "SonosPlay1Terrasse_coordinator"] ["Wohnzimmer",
                      "SonosPlay1Wohnzimmer_control",
                      "SonosPlay1Wohnzimmer_volume",
                      "SonosPlay1Wohnzimmer_coordinator"] ["Büro",
                      "SonosPlay5Buro_control", "SonosPlay5Buro_volume",
                      "SonosPlay5Buro_coordinator"] ["Moritz",
                      "SonosSYMFONISKMoritz_control",
                      "SonosSYMFONISKMoritz_volume",
                      "SonosSYMFONISKMoritz_coordinator"] ["Paula",
                      "SonosSYMFONISKPaula_control",
                      "SonosSYMFONISKPaula_volume",
                      "SonosSYMFONISKPaula_coordinator"]'
              - component: oh-grid-col
                config: {}
                slots:
                  default:
                - component: widget:widget_Sonos_Player
                  config:
                    propWidgetTitle: Sonos Wohnzimmer
                    itemTitle: SonosPlay1Wohnzimmer_Titel
                    itemAlbum: SonosPlay1Wohnzimmer_Album
                    itemArtist: SonosPlay1Wohnzimmer_Kunstler
                    itemCover: SonosPlay1Wohnzimmer_Coverbild
                    itemPlayer: SonosPlay1Wohnzimmer_control
                    itemVolume: SonosPlay1Wohnzimmer_ZoneVolume
                    propZoneName: Wohnzimmer
                    itemCoordinator: SonosPlay1Wohnzimmer_coordinator
                    propZoneArray: '["Esszimmer", "SonosPlay1Esszimmer_control",
                      "SonosPlay1Esszimmer_volume",
                      "SonosPlay1Esszimmer_coordinator"] ["Küche",
                      "SonosPlay1Kuche_control", "SonosPlay1Kuche_volume",
                      "SonosPlay1Kuche_coordinator"] ["Terrasse",
                      "SonosPlay1Terrasse_control",
                      "SonosPlay1Terrasse_volume",
                      "SonosPlay1Terrasse_coordinator"] ["Wohnzimmer",
                      "SonosPlay1Wohnzimmer_control",
                      "SonosPlay1Wohnzimmer_volume",
                      "SonosPlay1Wohnzimmer_coordinator"] ["Büro",
                      "SonosPlay5Buro_control", "SonosPlay5Buro_volume",
                      "SonosPlay5Buro_coordinator"] ["Moritz",
                      "SonosSYMFONISKMoritz_control",
                      "SonosSYMFONISKMoritz_volume",
                      "SonosSYMFONISKMoritz_coordinator"] ["Paula",
                      "SonosSYMFONISKPaula_control",
                      "SonosSYMFONISKPaula_volume",
                      "SonosSYMFONISKPaula_coordinator"]'
                        itemSonosRule: Sonos_Multiroom_Control
        - component: oh-grid-row
          config: {}
          slots:
            default: []
masonry: null

Thanks a lot for looking into this :slight_smile:

In this case ther seams to be an issue with the coordinator item itself. Normaly the coordinator items should be compared and only identical if the speakers are in the same group.

Please restart your openhab service and test again. If the issue still occours please provide me the current state of the three coordinator items.

After restarting openhab nothing changed. Every master item is a string item with the RINCON Number of her Thing -> 3 different values.

Thank you for your help!!!

Thanks for sharing the details. From what I can see it looks all fine. Beside some small formating issues on the YAML but I think they came during the YAML copy and on your side the formating should be fine.

Can you please try to reproduce the behavior again. So remove “Wohnzimmer” from your group and provide me the details of the wohnzimmer, schlafzimmer and also Küche “_coordinator” state.

Please take care that the speakers are playing during this test. Grouping of inactive speakers is theoretically possible but i already noticed some side effects due to the sonos binding. But normaly you only need grouping on active speakers :wink:

Ok thanks for the information. If all three values are different then we need to check the YAML structure again. I know you mentioned you have fixed the issue, but please confirm or paste the YAML structure of e.g. Wohnzimmer again to make shour you fixed this correctly. The issue must be located there, the widget compares the item coordinator of the current player with all coordinators of the zoneArray. If the coordinato is the same the checkbox will be filled. So if all 3 coordinators have different states then it can only be a widget configuration issue where all three widgets will have the same coordinator in the YAML.

Here the yamls:

component: widget:widget_Sonos_Player
config:
propWidgetTitle: Wohnzimmer
itemTitle: SonosPlaybarWohnzimmer_Titel
itemAlbum: SonosPlaybarWohnzimmer_Album
itemArtist: SonosPlaybarWohnzimmer_Kunstler
itemCover: SonosPlaybarWohnzimmer_Coverbild
itemPlayer: SonosPlaybarWohnzimmer_Fernbedienung
itemVolume: SonosPlaybarWohnzimmer_ZoneVolume
itemShuffle: SonosPlaybarWohnzimmer_Shuffle
itemRepeat: SonosPlaybarWohnzimmer_Wiederholen
propZoneName: Wohnzimmer
itemCoordinator: SonosPlaybarWohnzimmer_Master
itemSonosRule: Sonos_Multiroom_Control
propZoneArray: ‘[“Wohnzimmer”; “SonosPlaybarWohnzimmer_Fernbedienung”;
“SonosPlaybarWohnzimmer_Lautstarke”;
“SonosPlaybarWohnzimmer_Master”][“Küche”; “SonosMoveKuche_Fernbedienung”;
“SonosMoveKuche_Lautstarke”; “SonosMoveKuche_Master”] [“Schlafzimmer”;
“SonosPlay3Schlafzimmer_Fernbedienung”; “SonosPlay3Schlafzimmer_Lautstarke”;
“SonosPlay3Schlafzimmer_Master”]’

component: widget:widget_Sonos_Player
config:
propWidgetTitle: Küche
itemTitle: SonosMoveKuche_Titel
itemAlbum: SonosMoveKuche_Album
itemArtist: SonosMoveKuche_Kunstler
itemCover: SonosMoveKuche_Coverbild
itemPlayer: SonosMoveKuche_Fernbedienung
itemVolume: SonosMoveKuche_ZoneVolume
itemShuffle: SonosMoveKuche_Shuffle
itemRepeat: SonosMoveKuche_Wiederholen
propZoneName: Küche
itemCoordinator: SonosMoveKuche_Master
propZoneArray: ‘[“Schlafzimmer”; “SonosPlay3Schlafzimmer_Fernbedienung”;
“SonosPlay3Schlafzimmer_Lautstarke”;
“SonosPlay3Schlafzimmer_Master”][“Wohnzimmer”;
“SonosPlaybarWohnzimmer_Fernbedienung”; “SonosPlaybarWohnzimmer_Lautstarke”;
“SonosPlaybarWohnzimmer_Master”][“Küche”; “SonosMoveKuche_Fernbedienung”;
“SonosMoveKuche_Lautstarke”; “SonosMoveKuche_Master”]’
itemSonosRule: Sonos_Multiroom_Control

component: widget:widget_Sonos_Player
config:
propWidgetTitle: Schlafzimmer
itemTitle: SonosPlay3Schlafzimmer_Titel
itemAlbum: SonosPlay3Schlafzimmer_Album
itemArtist: SonosPlay3Schlafzimmer_Kunstler
itemCover: SonosPlay3Schlafzimmer_Coverbild
itemPlayer: SonosPlay3Schlafzimmer_Fernbedienung
itemVolume: SonosPlay3Schlafzimmer_ZoneVolume
itemShuffle: SonosPlay3Schlafzimmer_Shuffle
itemRepeat: SonosPlay3Schlafzimmer_Wiederholen
propZoneName: Schlafzimmer
itemCoordinator: SonosPlay3Schlafzimmer_Master
propZoneArray: ‘[“Schlafzimmer”; “SonosPlay3Schlafzimmer_Fernbedienung”;
“SonosPlay3Schlafzimmer_Lautstarke”;
“SonosPlay3Schlafzimmer_Master”][“Wohnzimmer”;
“SonosPlaybarWohnzimmer_Fernbedienung”; “SonosPlaybarWohnzimmer_Lautstarke”;
“SonosPlaybarWohnzimmer_Master”][“Küche”; “SonosMoveKuche_Fernbedienung”;
“SonosMoveKuche_Lautstarke”; “SonosMoveKuche_Master”]’
itemSonosRule: Sonos_Multiroom_Control

Hi Flo ,

here are the values:

SonosPlay1Esszimmer_coordinator RINCON_5CAAFD42750A01400
SonosPlay1Kuche_coordinator RINCON_5CAAFD42750A01400
SonosPlay1Wohnzimmer_coordinator RINCON_949F3E0811DE01400

@DocBrown and @johannesbonn I think i found the issue. I never tested to use three player widgets on the same page. Only on different pages because my layout is orderd by rooms and not by equipment.

I created the same setup like you and can confirm your behavior. Unfortunately I don’t think that I can solve this. For me this looks like an issue in the oh-repeater implementation if serval oh-repeater are located on the same page.

@ysc I think I found a bug in the oh-repeater. When placing the sonos widget three times on the screen with different parameter, only the parameter from the last oh-repeater are used. The result of this will be displayed on all oh-repeaters of this widget (So all 3 widgets have the same output inside the oh-repeater section.) When I only use one widget per page then the behavior is as expected and all works fine. Shall I open an issue on github for this?

I think I know why this happens.

2 Likes

@buschif4
Thanks a lot for looking into it. Let’s hope a solution can be found.

Should be fixed by Don't propagate loop to child widgets contexts by ghys · Pull Request #804 · openhab/openhab-webui · GitHub.

great thanks, I will test the snapshot release the next days. Many thanks for the fix.

@buschif4, thank you for the widget & rules! Very nice.

Let me suggest one clarification for your instructions to avoid a problem I had: The zone names in the widget speaker array config need to match the zone names in the Sonos_Multiroom_Control rule. If not, the zone cannot be added or removed by the rule.

1 Like

@Timothy_Ingle Thanks for the hint. I’ve always taken that for granted but you are right it should be mentioned to be on the safe side. I added this to the description.

Hello @buschif4,

I am using oh 3.1. How I have to consider the fix from @ysc. If I understand it right I have to add something in the widget code.

Thank you for your help!

Thanks for this widget.
I tried to implement it, however I don’t get anything shown beneath the volume control, So I have no selection posibility for my players.
I have setup the speaker array in the widget as:
["Wohnzimmer"; "PlayWohnzimmer_Fernbedienung"; "PlayWohnzimmer_Lautstarke"; "PlayWohnzimmer_Master"]["Buero", "PlayBuero_Fernbedienung"; "PlayBuero_Lautstarke"; "PlayBuero_Master"]["Kueche"; "PlayKueche_Fernbedienung"; "PlayKueche_Lautstarke"; "PlayKueche_Master"]["Gaestezimmer", "PlayGaestezimmer_Fernbedienung"; "PlayGaestezimmer_Lautstarke"; "PlayGaestezimmer_Master"]
All extensions are matching my channels and are set in the rule as well.
What am I missing? Anything else I need to post?