Sonos Player widget for OH3 mainUI

Tags: #<Tag:0x00007fc8fc6e0e98> #<Tag:0x00007fc8fc6e0c90> #<Tag:0x00007fc8fc6e0ba0>

Edit: Added oh-repeater function to replace current speaker placeholder and reduce code by 50%. Also this allows to use unlimited zone players with the new version.

In this topic i want to share my Sonos player with you. It is my replacement of the sonos controller app. In order to use the full features of this widget you need to use my multiroom rule. Without this the grouping and ungrouping of players will not work.

IMG_1577
How to use the widget:
In order to use all features of this widget you need to use my multiroom rule that is described here.

You can just copy my code below in a new widget. When you run the widget you can provide all items to it. as speaker array you need to provide your details in the following format. The speakers must be provided in the following format. Please ensure that the " around the item is still there. (The zoneName and all items inside the zoneArray must have the same name as provided in the linked multiroom rule.)

  • ["<zoneName>", “<…_player>”, “<…_volume>”, “<…_coordinator>”]

An example for the speaker array is below.

  • [“living room”; “Sonos_livingroom_player”; “Sonos_livingroom_volume”; “Sonos_livingroom_coordinator”][“bed room”, “Sonos_bedroom_player”; “Sonos_bedroom_volume”; “Sonos_bedroom_coordinator”]

If you are using my sonos multiroom volume rule you should provide as volume item the zoneVolume item that was created for the rule. (Only on the item selector if the widget. Inside the item array keep the original volume item so that the widget can control both.)

The widget code

uid: widget_Sonos_Player
tags: []
props:
  parameters:
    - description: (optional) widget title
      label: (optional) widget title
      name: propWidgetTitle
      required: false
      type: TEXT
    - context: item
      description: item to display the title
      label: item title
      name: itemTitle
      required: true
      type: TEXT
    - context: item
      description: (optional) item to display the album
      label: (optional) item album
      name: itemAlbum
      required: false
      type: TEXT
    - context: item
      description: (optional) item to display the artist
      label: (optional) item artist
      name: itemArtist
      required: false
      type: TEXT
    - context: item
      description: (optional) item to display a cover image
      label: (optional) item cover image
      name: itemCover
      required: false
      type: TEXT
    - context: item
      description: (optional) item to control the player
      label: (optional) item player
      name: itemPlayer
      required: false
      type: TEXT
    - context: item
      description: (optional) item to control the volume
      label: (optional) item volume
      name: itemVolume
      required: false
      type: TEXT
    - context: item
      description: (optional) item for shuffle option
      label: (optional) item shuffle
      name: itemShuffle
      required: false
      type: TEXT
    - context: item
      description: (optional) item for repeat option
      label: (optional) item repeat
      name: itemRepeat
      required: false
      type: TEXT
    - description: (optional) Name of the zone player
      label: (optional) Zone name
      name: propZoneName
      required: false
      type: TEXT
      advanced: true
    - context: item
      description: (optional) item of the zone coordinator channel
      label: (optional) item coordinator
      name: itemCoordinator
      required: false
      type: TEXT
      advanced: true
    - description: (optional) speaker array like this -> ["<zoneName>", "<player>", "<volume>", "<coordinator>"]["<zoneName2>", "<player2>", "<volume2>", "<coordinator2>"]
      label: (optional) speaker array
      name: propZoneArray
      required: false
      type: TEXT
      advanced: true
    - context: item
      description: (optional) item for the sonos mulltiroom rule. e.g. Sonos_Multiroom_Control
      label: (optional) item to control the multiroom control rule
      name: itemSonosRule
      required: false
      type: TEXT
      advanced: true
  parameterGroups: []
timestamp: Dec 22, 2020, 11:23:18 AM
component: f7-card
config:
  title: =props.propWidgetTitle
slots:
  default:
    - component: f7-card-content
      slots:
        default:
          - component: f7-row
            slots:
              default:
                - component: Label
                  config:
                    text: "Title: "
                    class:
                      - display-flex
          - component: f7-row
            config:
              style:
                position: relative
                top: -10px
                height: 30px
              class:
                - justify-content-center
            slots:
              default:
                - component: Label
                  config:
                    text: =items[props.itemTitle].displayState || items[props.itemTitle].state
                    style:
                      fontSize: 28px
                      white-space: nowrap
                      overflow: hidden
          - component: f7-row
            config:
              visible: "=(props.itemAlbum) ? true : false"
            slots:
              default:
                - component: Label
                  config:
                    text: "Album: "
                    class:
                      - display-flex
          - component: f7-row
            config:
              visible: "=(props.itemAlbum) ? true : false"
              style:
                position: relative
                top: -10px
                height: 30px
              class:
                - justify-content-center
            slots:
              default:
                - component: Label
                  config:
                    text: =items[props.itemAlbum].displayState || items[props.itemAlbum].state
                    style:
                      fontSize: 28px
                      white-space: nowrap
                      overflow: hidden
          - component: f7-row
            config:
              visible: "=(props.itemArtist) ? true : false"
            slots:
              default:
                - component: Label
                  config:
                    text: "Artist: "
                    class:
                      - display-flex
          - component: f7-row
            config:
              visible: "=(props.itemArtist) ? true : false"
              style:
                position: relative
                top: -10px
                height: 30px
              class:
                - justify-content-center
            slots:
              default:
                - component: Label
                  config:
                    text: =items[props.itemArtist].displayState || items[props.itemArtist].state
                    style:
                      fontSize: 28px
                      white-space: nowrap
                      overflow: hidden
          - component: f7-row
            config:
              visible: "=(props.itemCover) ? true : false"
              class:
                - margin-vertical
                - justify-content-center
            slots:
              default:
                - component: oh-image
                  config:
                    item: =props.itemCover
                    style:
                      width: 70%
          - component: f7-row
            config:
              visible: "=(props.itemPlayer) ? true : false"
              class:
                - justify-content-space-around
                - display-flex
                - align-items-center
                - align-content-stretch
                - margin-top
              style:
                position: relative
                top: +5px
            slots:
              default:
                - component: f7-icon
                  config:
                    f7: '=(props.itemShuffle) ? "shuffle" : ""'
                    size: 20
                    color: '=(items[props.itemShuffle].state === "ON") ? "green" : ""'
                    style:
                      position: relative
                      left: +7%
                  slots:
                    default:
                      - component: oh-button
                        config:
                          action: command
                          actionItem: =props.itemShuffle
                          actionCommand: '=(items[props.itemShuffle].state !== "ON") ? "ON" : "OFF"'
                          style:
                            position: absolute
                            width: 100%
                            height: 100%
                            top: 0px
                - component: oh-player-item
                  config:
                    style:
                      width: 150px
                    item: =props.itemPlayer
                    class:
                      - display-flex
                      - margin-
                      - align-content-stretch
                      - align-items-center
                      - justify-content-space-around
                - component: f7-icon
                  config:
                    f7: '=(props.itemRepeat) ? (items[props.itemRepeat].state === "ALL") ? "repeat" : (items[props.itemRepeat].state === "ONE") ? "repeat_1" : "repeat" : ""'
                    size: 20
                    color: '=(items[props.itemRepeat].state === "ALL") ? "green" : (items[props.itemRepeat].state === "ONE") ? "green" : ""'
                    style:
                      position: relative
                      left: -8%
                  slots:
                    default:
                      - component: oh-button
                        config:
                          action: command
                          actionItem: =props.itemRepeat
                          actionCommand: '=(items[props.itemRepeat].state === "ALL") ? "ONE" : (items[props.itemRepeat].state === "ONE") ? "OFF": "ALL"'
                          style:
                            position: absolute
                            width: 100%
                            height: 100%
                            top: 0px
          - component: f7-row
            config:
              visible: "=(props.itemVolume) ? true : false"
              class:
                - justify-content-space-around
                - display-flex
                - align-items-center
                - align-content-stretch
            slots:
              default:
                - component: f7-card
                  config:
                    noShadow: true
                    class: margin display-flex align-items-center
                    style:
                      fontSize: 20px
                      min-width: calc(100% - 20px)
                  slots:
                    default:
                      - component: f7-icon
                        config:
                          f7: speaker_3
                          class: margin-horizontal margin
                          size: 30
                      - component: oh-slider
                        config:
                          label: true
                          style:
                            height: +40px
                            width: calc(100% - 35px)
                          min: 0
                          item: =props.itemVolume
                          class:
                            - display-flex
                            - margin-horizontal
                            - align-content-stretch
                            - align-items-center
                            - justify-content-space-around
                      - component: f7-button
                        config:
                          class: '=(props.propZoneArray) ? "" : "display-none"'
                          style:
                            position: absolute
                            height: 100%
                            width: 100%
                            top: 0px
                          popoverOpen: .popoverVolume
                        slots:
                          default:
                            - component: f7-popover
                              config:
                                class: popoverVolume
                                style:
                                  min-width: 350px
                              slots:
                                default:
                                  - component: oh-repeater
                                    config:
                                      for: zoneVolume
                                      in: =props.propZoneArray.split("]")
                                      containerClasses:
                                        - display-flex
                                        - flex-direction-column
                                    slots:
                                      default:
                                        - component: f7-card
                                          config:
                                            class: '=(loop.zoneVolume.split("\"")[1] && items[loop.zoneVolume.split("\"")[7]].state === items[props.itemCoordinator].state) ? "display-flex flex-direction-row justify-content-flex-start align-items-center" : "display-none"'
                                            style:
                                              height: 40px
                                          slots:
                                            default:
                                              - component: Label
                                                config:
                                                  style:
                                                    fontSize: 20px
                                                  class:
                                                    - margin-left
                                                  text: =(loop.zoneVolume.split("\"")[1])
                                              - component: oh-slider
                                                config:
                                                  label: true
                                                  style:
                                                    height: +40px
                                                    width: calc(100% - 40%)
                                                  min: 0
                                                  item: =(loop.zoneVolume.split("\"")[5])
                                                  class:
                                                    - display-flex
                                                    - margin
                                                    - align-content-stretch
                                                    - align-items-center
          - component: f7-row
            config:
              class: '=(props.propZoneName && props.itemPlayer) ? "justify-content-space-around align-items-center align-content-stretch" : "display-none"'
              style:
                position: relative
                top: -26px
                height: 50px
            slots:
              default:
                - component: f7-card
                  config:
                    noShadow: true
                    class: display-flex align-items-center
                    style:
                      fontSize: 20px
                      min-width: 130px
                  slots:
                    default:
                      - component: f7-icon
                        config:
                          f7: hifispeaker
                          size: 30
                          class: margin
                      - component: Label
                        config:
                          class: margin-right
                          text: =props.propZoneName
                          style:
                            fontSize: 20px
                      - component: f7-icon
                        config:
                          f7: '=(items[props.itemPlayer].state === "PLAY") ? "chart_bar_alt_fill" : ""'
                          class: margin-right
                          size: 20
                      - component: f7-button
                        config:
                          class: '=(props.propZoneArray) ? "" : "display-none"'
                          style:
                            position: absolute
                            height: 100%
                            width: 100%
                            top: 0px
                          popoverOpen: .popoverPlayer
                        slots:
                          default:
                            - component: f7-popover
                              config:
                                class: popoverPlayer
                                style:
                                  min-width: 280px
                              slots:
                                default:
                                  - component: oh-repeater
                                    config:
                                      for: zoneSpeaker
                                      in: =props.propZoneArray.split("]")
                                      containerClasses:
                                        - display-flex
                                        - flex-direction-column
                                    slots:
                                      default:
                                        - component: f7-card
                                          config:
                                            class: '=(loop.zoneSpeaker.split("\"")[1]) ? "display-flex flex-direction-row align-items-center" : "display-none"'
                                            style:
                                              height: 40px
                                          slots:
                                            default:
                                              - component: oh-button
                                                config:
                                                  style:
                                                    position: absolute
                                                    top: 0px
                                                    width: 100%
                                                    height: 100%
                                                  action: command
                                                  actionItem: =props.itemSonosRule
                                                  actionCommand: '=(items[loop.zoneSpeaker.split("\"")[7]].state === items[props.itemCoordinator].state) ? "Remove:" + loop.zoneSpeaker.split("\"")[1] + "" : "Add:" + loop.zoneSpeaker.split("\"")[1] + "@" + props.propZoneName'
                                              - component: f7-col
                                                config:
                                                  class: margin display-flex flex-direction-row align-items-center
                                                slots:
                                                  default:
                                                    - component: f7-icon
                                                      config:
                                                        f7: '=(items[loop.zoneSpeaker.split("\"")[7]].state === items[props.itemCoordinator].state) ? "checkmark_alt_circle_fill" : "circle"'
                                                    - component: Label
                                                      config:
                                                        class: margin-left
                                                        text: =loop.zoneSpeaker.split("\"")[1]
                                                        style:
                                                          fontSize: 20px
                                              - component: f7-col
                                                config:
                                                  class: margin align-items-center
                                                slots:
                                                  default:
                                                    - component: f7-icon
                                                      config:
                                                        f7: '=(items[loop.zoneSpeaker.split("\"")[3]].state === "PLAY") ? "chart_bar_alt_fill" : ""'
12 Likes

Your should links both sonos Threads :slight_smile:

@Dibbler42 yes i missed this. But done right now (hopefully)

1 Like

Hello Flo,

I really like this widget. Thanks for sharing it here.
Just some quick notes from my setup procedure:

  • The speaker array that has to be put in the widegt configuration does not like the ‘“’ and ‘”’ characters that are used in the community here. So make sure to use the " character yourself when writing the array.
  • The widget configuration is asking for a “master channel item”. I had to browse through the code to figure out what kind of item was needed here: the coordinator. So maybe change this field to something like “item of the zone coordinator”.
  • In the widget code, the actionItem is still set to Sonos_Multiroom_Steuerung in multiple places. I changed it to the name of my multiroom control item manually. Maybe it could also be set with the configuration?

After that, it works quite well. I am just having some trouble with the zone volume control. But here, I am not sure whether it’s my mistake. It’s updating when I change individual volumes, but the individual volumes do not update when I change the zone volume. I will let you know once I fixed that.

By the way: when not using dark mode, the volume control and zone selection show a small border. In dark mode, these borders are not as visible. But maybe it can be fixed to show no borders at all.

Once again, thanks for your contribution.

1 Like

@fxpde thanks for your feedback. I will have a look on this this afternoon and modify the widget accordingly. (Especially regarding the master/coordinator channel and the hardcoded sonos multiroom control item).

Regarding the volume control. Have you used my volume control rule that is linked to the widget? If yes you need to define in the player array the normal volume channel of the speaker and as volume item the temporary _ZoneVolume item that was created for the volume control rule. Then you should not have any issues with the zone volume.

Hello Felix,

so a new Version of the widget is in the first post. All your repored issues are adressed:

  1. I added another description to this to make it more clear. e.g. [""… ] now the zonename is marked as to highlight that the ‘"’ is needed. Also the description in the first point was modified.

  2. Master channel was an historical issue. I changed this to coordinator and adapted the input description.

  3. The static item was removed. Thanks for this I missed this completely :wink:

  4. The boarders on volume and zone selector are gone now.

Regarding your volume control issue, what OH version are you using? OH3 M2? There is an issue with a rule trigger in the M2 release. You ned to specify all items individually to the rule because group item member is not working as trigger when you choose item received a command. Or update to M3 release and you will be happy :slight_smile:

By the way, do you know how to send a spotify playlist to sonos speakers? I want to extend the widget for an Tunein radio and Spotify sidebar that is collapsable.

3 Likes

Awesome. Not only does the widget look even better now, also the zone volume control works like a charm after the update to M3. Thanks for the hint :slight_smile:

I haven’t looked into sending Spotify playlists to the speaker yet, but that’s definitely on my todo list. I plan to look into that this weekend.

1 Like

Another bug I just noticed, or at least minor flaw: when removing a speaker from the current group, the zone volume is not updated. I guess a new trigger would need to be added to the zone volume rule. Maybe something like “When a member of new group with all coordinators changed”. Or do you have any more elegant/efficient ideas?

Hi Felix, you are right i missed this scenario. I will update the rule later.

When you have a possibility to send a spotify playlist to sonos let me know. Then i can extend the current widget and also call the spotify api with an access token from the spotify binding to get some images for the latest playlists

Hi Felix,

i fixed the bug. You need to copy the rule again. Additionally you need a group with all coordinator items as wirtten in the rule documentation. This will then be ues as trigger when a group member changed as you suggested. I tried to reuse the play group to avoid having another group. But then the rule runs before the coordinator item as changed so this was no possibilits.

Also I noticed that the rule is somehow delayed on M3 release. I tested with the old an new version and bot versions have the same behavior. The item is only updated on every second command and gets the previous state. This was not the case on M2 release. Do you have the same behavior? I will open an issue on OH-core repository.

Hey @buschif4,

I tried to create the rules and the widget and am struggling a bit.

I have a fresh OH3 install on a Pi4. First I added the my two Sonos players which worked fine and I am able to control them. The only ugly thing is, the system defined them in german, so eg. SonosOneKuche_Fernbedienung, instead of _control. But due its working, fine.

So I did all the steps of your first post for rule 1 and 3. rule 2 I skipped for the moment and implemented the widget. Problem is, the widget is not working as it should. I see the speaker, but can’t select one. If I click on the volume, the whole screen is grey, but I can’t select any slider.

I will post my configuration, maybe you can help me out with this…
I defined the players. My standard player items name is SonosOneKuche e.g.

I changed then the rule based on my items:
e.g. SonosOneKuche_Lautstärke (for the volume item)

For the trigger I entered the volume created based on your point 3, the Sonos_Multiroom_Controll item.

Next rule was the one for the volume control. I entered here the content according to the what I have. The one Group_Sonos item as well as the other items e.g. SonosOneKuche_ZoneVolume.

Triggers as shown here

I grouped all the items as requested, but I can’t control the widget. I can open the speaker menu, but can’t select a speaker. I can click on volume, but only my display greys a bit, nothing happens. My definition:

I am really a bit lost, where my mistake could be. I guess it should be somewhere in the rule adjustment.

Thank you in advance.

Woogi

Hey @buschif4,

sorry, me again :smiley:

I tried it another time with new item definition and exact naming as in your example.

I still can’t select the speaker in the widget:

Do you have an idea why? is there a specific group config required?
Another question is, what item I should take as player? If I enter the created multiroom_control item, it does not work, speaker are not reacting. Is there a group item required or should it work with that one? any hints? maybe @fxpde have you an idea as well what I am missing.

kindly,
Woogi

Hi Woogi, from what I can see i think the item definition of the widget is wrong.

You selected the group items on the widget as item channel. This is not working. Please define the items from the main speaker.

Let me give you an german example from my setup :wink:


Hi Flo,

thanks a lot for this cool widget. I really appreciate your contribution.
I’m playing around with it since several days and I think I found one issue. Maybe you could have a look into it and confirm (any maybe solve it)

When I’m placing only one sonos widget in one page it works very well.
I’ve tried to place 7 sonos widget on one page for all my sonos speaker (so that I can see in one view what they are playing).
This works as long as all speakers are in one group.
But as soon as I is in a different group the grouping and zone volume doesn’t show correctly anymore.

I assume there is a problem with global variables that are concurrently used by the widgets and then they get mixed up.

Would be grear if you could have a look at this :slight_smile:

Thanks a lot.

Regards

Hi @DocBrown I think here is an misunderstanding regarding the grouping. The Sonos devices can be located in different groups without any issues. But if you want to use this widget you need additional groups beside the default one.

As prerequirement to use the zone volume you need to use ethe linked sonos multiroom rule. I belive you use this already? If not please install this first. Then continue here to understand the grouping.

So. e.g. you have 3 Sonos speakers. you can place all of them in the same or in different groups that makes no difference for the widget. You just need to create additional groups like “Group_Sonos_ZoneVolume” where you only place the items that are related to zone volume.

And the same for the normal volume items so -> “Group_Sonos_Volumes”. Now place all volume items from your sonos speakers in the second group and all zone volume items in the _zonevolume group. The rule will loop in the group and update all item states automatically.

If yopu have still issues please give me some more insights what steps you have done so far and how your items and devices are grouped.

Hi Flo,

I think we habe more missunderstandings - I’m referring to the grouping of speakers for playback - not the openhab groups.
But let’s start from the beginning.
I’ve installed all your rules and created the items and (openhab) groups based on your manual.
To do this I’ve created this items file for easy use.

Group gSonos
Group gSonos_ZoneVolume
Group gSonos_Volumes
Group gSonos_Coordinators

Player SonosPlay1Esszimmer_control (gSonos)  {channel="sonos:PLAY1:RINCON_5CAAFD4E748601400:control" }
Dimmer SonosPlay1Esszimmer_volume (gSonos, gSonos_Volumes) {channel="sonos:PLAY1:RINCON_5CAAFD4E748601400:volume" }
String SonosPlay1Esszimmer_add (gSonos) {channel="sonos:PLAY1:RINCON_5CAAFD4E748601400:add" }
String SonosPlay1Esszimmer_remove (gSonos) {channel="sonos:PLAY1:RINCON_5CAAFD4E748601400:remove" }
Switch SonosPlay1Esszimmer_standalone (gSonos) {channel="sonos:PLAY1:RINCON_5CAAFD4E748601400:standalone" }
String SonosPlay1Esszimmer_coordinator (gSonos, gSonos_Coordinators) {channel="sonos:PLAY1:RINCON_5CAAFD4E748601400:coordinator" }
String SonosPlay1Esszimmer_tuneinstationid (gSonos) {channel="sonos:PLAY1:RINCON_5CAAFD4E748601400:tuneinstationid" }
Dimmer SonosPlay1Esszimmer_ZoneVolume (gSonos_ZoneVolume)

Player SonosPlay1Kuche_control (gSonos)  {channel="sonos:PLAY1:RINCON_5CAAFD42750A01400:control" }
Dimmer SonosPlay1Kuche_volume (gSonos, gSonos_Volumes) {channel="sonos:PLAY1:RINCON_5CAAFD42750A01400:volume" }
String SonosPlay1Kuche_add (gSonos) {channel="sonos:PLAY1:RINCON_5CAAFD42750A01400:add" }
String SonosPlay1Kuche_remove (gSonos) {channel="sonos:PLAY1:RINCON_5CAAFD42750A01400:remove" }
Switch SonosPlay1Kuche_standalone (gSonos) {channel="sonos:PLAY1:RINCON_5CAAFD42750A01400:standalone" }
String SonosPlay1Kuche_coordinator (gSonos, gSonos_Coordinators) {channel="sonos:PLAY1:RINCON_5CAAFD42750A01400:coordinator" }
String SonosPlay1Kuche_tuneinstationid (gSonos) {channel="sonos:PLAY1:RINCON_5CAAFD42750A01400:tuneinstationid" }
Dimmer SonosPlay1Kuche_ZoneVolume (gSonos_ZoneVolume)

Player SonosPlay1Terrasse_control (gSonos)  {channel="sonos:PLAY1:RINCON_7828CA21DB0401400:control" }
Dimmer SonosPlay1Terrasse_volume (gSonos, gSonos_Volumes) {channel="sonos:PLAY1:RINCON_7828CA21DB0401400:volume" }
String SonosPlay1Terrasse_add  (gSonos) {channel="sonos:PLAY1:RINCON_7828CA21DB0401400:add" }
String SonosPlay1Terrasse_remove (gSonos) {channel="sonos:PLAY1:RINCON_7828CA21DB0401400:remove" }
Switch SonosPlay1Terrasse_standalone (gSonos) {channel="sonos:PLAY1:RINCON_7828CA21DB0401400:standalone" }
String SonosPlay1Terrasse_coordinator (gSonos, gSonos_Coordinators) {channel="sonos:PLAY1:RINCON_7828CA21DB0401400:coordinator" }
String SonosPlay1Terrasse_tuneinstationid (gSonos) {channel="sonos:PLAY1:RINCON_7828CA21DB0401400:tuneinstationid" }
Dimmer SonosPlay1Terrasse_ZoneVolume (gSonos_ZoneVolume)

Player SonosPlay1Wohnzimmer_control (gSonos)  {channel="sonos:PLAY1:RINCON_949F3E0811DE01400:control" }
Dimmer SonosPlay1Wohnzimmer_volume (gSonos, gSonos_Volumes) {channel="sonos:PLAY1:RINCON_949F3E0811DE01400:volume" }
String SonosPlay1Wohnzimmer_add (gSonos) {channel="sonos:PLAY1:RINCON_949F3E0811DE01400:add" }
String SonosPlay1Wohnzimmer_remove (gSonos) {channel="sonos:PLAY1:RINCON_949F3E0811DE01400:remove" }
Switch SonosPlay1Wohnzimmer_standalone (gSonos) {channel="sonos:PLAY1:RINCON_949F3E0811DE01400:standalone" }
String SonosPlay1Wohnzimmer_coordinator (gSonos, gSonos_Coordinators) {channel="sonos:PLAY1:RINCON_949F3E0811DE01400:coordinator" }
String SonosPlay1Wohnzimmer_tuneinstationid (gSonos) {channel="sonos:PLAY1:RINCON_949F3E0811DE01400:tuneinstationid" }
Dimmer SonosPlay1Wohnzimmer_ZoneVolume (gSonos_ZoneVolume)

Player SonosPlay5Buro_control (gSonos)  {channel="sonos:PLAY5:RINCON_000E588275D201400:control" }
Dimmer SonosPlay5Buro_volume (gSonos, gSonos_Volumes) {channel="sonos:PLAY5:RINCON_000E588275D201400:volume" }
String SonosPlay5Buro_add (gSonos) {channel="sonos:PLAY5:RINCON_000E588275D201400:add" }
String SonosPlay5Buro_remove (gSonos) {channel="sonos:PLAY5:RINCON_000E588275D201400:remove" }
Switch SonosPlay5Buro_standalone (gSonos) {channel="sonos:PLAY5:RINCON_000E588275D201400:standalone" }
String SonosPlay5Buro_coordinator (gSonos, gSonos_Coordinators) {channel="sonos:PLAY5:RINCON_000E588275D201400:coordinator" }
String SonosPlay5Buro_tuneinstationid (gSonos) {channel="sonos:PLAY5:RINCON_000E588275D201400:tuneinstationid" }
Dimmer SonosPlay5Buro_ZoneVolume (gSonos_ZoneVolume)

Player SonosSYMFONISKMoritz_control (gSonos)  {channel="sonos:SYMFONISK:RINCON_347E5CFFA88001400:control" }
Dimmer SonosSYMFONISKMoritz_volume (gSonos, gSonos_Volumes) {channel="sonos:SYMFONISK:RINCON_347E5CFFA88001400:volume" }
String SonosSYMFONISKMoritz_add (gSonos) {channel="sonos:SYMFONISK:RINCON_347E5CFFA88001400:add" } 
String SonosSYMFONISKMoritz_remove (gSonos) {channel="sonos:SYMFONISK:RINCON_347E5CFFA88001400:remove" }
Switch SonosSYMFONISKMoritz_standalone (gSonos) {channel="sonos:SYMFONISK:RINCON_347E5CFFA88001400:standalone" }
String SonosSYMFONISKMoritz_coordinator (gSonos, gSonos_Coordinators) {channel="sonos:SYMFONISK:RINCON_347E5CFFA88001400:coordinator" }
String SonosSYMFONISKMoritz_tuneinstationid (gSonos) {channel="sonos:SYMFONISK:RINCON_347E5CFFA88001400:tuneinstationid" }
Dimmer SonosSYMFONISKMoritz_ZoneVolume (gSonos_ZoneVolume)

Player SonosSYMFONISKPaula_control (gSonos)  {channel="sonos:SYMFONISK:RINCON_347E5CF39EEC01400:control" }
Dimmer SonosSYMFONISKPaula_volume (gSonos, gSonos_Volumes) {channel="sonos:SYMFONISK:RINCON_347E5CF39EEC01400:volume" }
String SonosSYMFONISKPaula_add (gSonos) {channel="sonos:SYMFONISK:RINCON_347E5CF39EEC01400:add" }
String SonosSYMFONISKPaula_remove (gSonos) {channel="sonos:SYMFONISK:RINCON_347E5CF39EEC01400:remove" }
Switch SonosSYMFONISKPaula_standalone (gSonos) {channel="sonos:SYMFONISK:RINCON_347E5CF39EEC01400:standalone" }
String SonosSYMFONISKPaula_coordinator (gSonos, gSonos_Coordinators) {channel="sonos:SYMFONISK:RINCON_347E5CF39EEC01400:coordinator" }
String SonosSYMFONISKPaula_tuneinstationid (gSonos) {channel="sonos:SYMFONISK:RINCON_347E5CF39EEC01400:tuneinstationid" }
Dimmer SonosSYMFONISKPaula_ZoneVolume (gSonos_ZoneVolume)

String Sonos_Multiroom_Control

When I now place 3 widgets on one page and all speaker are in the same Sonos Grouping everything looks find - as you can see on the screenshots:

But if I now remove the 3rd speaker (Wohnzimmer) from the grouping and let it play another song.
Then the speaker symbol of the first speaker look like you would expect it to look for the 3rd speaker:
Screenshot 3

Same for the speaker symbol
Screenshot 4

So to me it looks like the settings are always taken from the last speaker on the page.

Hope you understand what I’m trying to say.

Thanks already for your help

(I have to post the screenshot separately because I’m a new user - only 3 posts in a row a possible)

Screenshot 3

Screenshot 4

Hello @buschif4,

Thank you for your widget! But I have some problems to get the m ultiroom rule running. I have everything configured like mentioned in your post. I can group players but I get no hook beside the added room. Addionally nothing happens if I click on the volume to change it for the grouped players. The log show nothing… Any idea or hint? Here my config of the rule:

var sonosSpeakers = [
  ["Schlafzimmer", "SonosPlay3Schlafzimmer", "RINCON_XXX"],
  ["Wohnzimmer", "SonosPlaybarWohnzimmer", "RINCON_XXX"],
  ["Küche", "SonosMoveKuche", "RINCON_XXX"]
];


//default volume in hours
var defaultSpeakerVolume = [8, 8, 8, 8, 8, 8, 8, 10, 12, 14, 16, 18, 18, 20, 20, 20, 20, 18, 18, 16, 14, 12, 10, 8]

//default play uri can pe a uri or tunein station id depending of the playuri item
var defaultPlayUri = "24878"

//group where all sonos items belong to (can be a nested group)
var itemGroupName = "Group_Sonos";

//Player item extension (defines the player status)
var itemPlayExtensionName = "_Fernbedienung";

//Volume item extension (controls the volume of the player)
var itemVolumeExtensionName = "_Lautstarke";

//Add-speaker item extension (adds a speaker to the zone coordinator)
var itemAddExtensionName = "_Hinzufugen";

//Remove-speaker item extension (removes speaker from the zone coordinator)
var itemRemoveExtensionName = "_Entfernen";

//Play-Uri item extension (needed to play a uri on a new group)
var itemPlayUriExtensionName = "_TuneInSenderId";
//var itemPlayUriExtensionName = "_URIabspielen";

//Standalone item extension (needed to remove player if this is the coordinator in a multiroom zone)
var itemStandaloneExtensionName = "_StandAlone";

//Coordinator item extension (displays the master of this zone)
var itemMasterExtensionName = "_Master";

Thank you for your help.

@DocBrown thanks for sharing this. I see the issue but for me it is not clear why this happens. Can you share the YAML code of your widget configuration. So e.g. the YAML of your “Sonot test 2” tab page.

I think then I can understand it better and probably also provide you a solution :wink: