Join Sonos speakers using media_player.join

In 2022.8 there were breaking changes for joining Sonos speakers. We are now supposed to use media_player.join. But how do I list more than one entity in JSON now when I need to set group_members in the data field in NR?

click the load example data button, it should load this

{
   "group_members":"- media_player.multiroom_player2\n- media_player.multiroom_player3\n"
}

image

Thanks, but I can´t get that one to work either. With the string

{
   "group_members":"- media_player.sovrum\n- media_player.vardagsrum\n"
}

I get the API Error

Call-service error. Entity ID - media_player.sovrum
- media_player.vardagsrum
 is an invalid entity ID @ data['group_members'][0]

What am I missing?

I think that is a typo, try

{
  "group_members": [
    "media_player.sovrum",
    "media_player.vardagsrum"
  ]
}
1 Like

That did work, thanks @Mikefila

Hi, now i try to solved problem with media_player.join sonos speakers. If I join next speaker into group, it will be stoped playing. Do you know somebody how to solving? Grouping is succesfull but, playing is stoped.

entity_id: media_player.symfonisk_loznice - this I want to connected

data in node:

{
   "group_members": [
    "media_player.symfonisk_obyvak_stereo",
    "media_player.symfonisk_kuchyn_stereo"
  ]
}
{
  "group_members": [
    "media_player.symfonisk_obyvak_stereo",
    "media_player.symfonisk_kuchyn_stereo"
  ]
}

spacing

1 Like

Spacing wasn´t my problem, but thanks for correct. After adding next speaker, are groups renamed. Before was - “obyvak+1” after “loznice+2” I think that is problem.

Old variant call service - sonoss.join was working right.

If you use the older script.say type variant for Sonos speakers you’ll need to update the script section to use the media_player.join service and also the group_members variable:

    - service: media_player.join
      data_template:
        group_members: "{{ where }}"
        entity_id: "{{ master }}"

And the resulting automation array variable change:

      data_template:
        variables:
          master: 'media_player.office'
          where: '["media_player.chalkboard_room","media_player.kitchen","media_player.loft","media_player.office"]'