Sonos - sonos_join - syntax

Hello everybody,

This is my first project with Home Assistant and i like this thing :slight_smile: but i’m an amateur…

I have three Sonos Play1 boxes.

What i want do:
i will on the main Page a button to start playing all Sonos in a group (sonos_join) but i don’t understand the code for this…

can somebody help?

Thank you!

Here is a script I use to join two of my sonos speakers together and then plays a mp3. Modify as needed

First I turn off the script in case it is already running. Then I snapshot the speakers (in case they are playing anything already), then I unjoin those speakers in case they are joined with others (I have 4 speakers total). We set the volume and then play. Notice when we get to the play portion I only call 1 speaker. This is the master speaker identified in the join command. Hope it helps. I took most of this from one of the public configs someone posted. Sorry I don’t recall who! :slight_smile:

https://pastebin.com/MfqMnuVy

5 Likes

Thank you!! :slight_smile: it’s work

Does the master have to be in the room your playing? So if I say the master is living room can I still only play in the basement? Or would the basement need to be master?

I’m creating a bunch of join scripts for dashboard and it would be easier to always have the same master.

Hi

I would like to join two Sonos speakers and I tried to follow the above but does not work. I have this in my automation.yaml:

action:
´ - service: sonos.join
data:
master: media_player.orangeri
entity_id:
- media_player.orangeri_2
mode: single

How does the Sonos integration and the “media_player” service interact ?

Please re-format.