Group a Sonos device to a main device when presence (e.g. motion) is detected and the main device is playing music.
Can be extended with custom conditions, for example, only group the Sonos when you’re not asleep.
The Automation Process:
In this example we will use a motion sensor as the trigger but you can use one or multiple Binary Sensors as the trigger/s.
Triggers on a motion sensor and adds the Sonos speaker (target) in the room to a group (source).
When no motion is detected, a time delay is activated and removes the Sonos player from the group Automatically.
The Sonos speaker will remain GROUPED if the motion sensor detects motion before the time delay removes the Sonos speaker from the group. It will then reset the time delay after last motion is detected.
You have the option to add “Custom conditions”. This allows you to extend this blueprint with more advanced YAML syntax.
You have the option to set the “Allow TV” option. When selected, the target Sonos Speaker will join the group even if the group is playing audio from the TV.
You have the option to adjust the “Time Delay”. This will increase or decrease the amount of time it will take before the target Sonos Speaker will leave the group again.
Im extending this blueprint with an option to set the volume. which worked, but i want to make it pretty and dont change the volume if none has been set.
and that last part i cant get to work. As this is my first work on a script or blueprint in home assistant ever can i get a bit of help?
Is it possible to specify several Sonos speakers here as a source for grouping?
I have 3 rooms and would like to group them one by one as you go into the rooms.
The whole thing should be dynamic, since the room where the music was played changes here and there.
I tried changing multiple to true in the blueprint for source, but it didn’t work.
If you split the blueprint at the moment, the last speaker will simply be grouped out again.
It would be better if the speakers were gradually grouped together and then gradually removed from the group again.
Hi, did you manage to get the “last part” working? If I understand you currently you want the “long press on play” that you can do on each device, right? It will join the last active session. Would be a great feature to have
This just finds the last updated media players entity name. This should be similar to what a long press on the playbutton on a sonos device actually does.
What I fail to understand is how to then use the entity (that I now have as a string) in the blueprint above. Can I make a sensor return an entity? Greateful for all help here. Thanks