Sonos Smart Groups — Dynamically (un)group and tune Sonos rooms without touching a button


Install through HACS as a custom repository, category Integration. The blueprint installs itself; there is nothing to reload.

What it is

A custom integration plus one blueprint. Each automation you create from the
blueprint describes a single smart group: one leader room, any number of
followers.

  • Every follower gets a volume factor. The living room sits at 1.3 and
    stays there. Move the kitchen slider and the whole floor follows, each room
    keeping its balance.
  • Bass, treble, loudness, surround and night sound are copied too — Sonos
    keeps those per room, which is why a group can still sound like several
    systems rather than one. Bass and treble get their own per-room factor, so
    the room in the corner can run 0.8 and stop booming.
  • Groups can outrank each other. Mark the home theater as superior and it
    takes precedence when a film starts: the music group hands its rooms over and
    rebuilds itself when the film ends.
  • Groups can start themselves on any trigger you can express — motion, a
    time of day, an NFC tag — playing a favourite or switching to an input.

It works with the Sonos integration and with Music Assistant players.


I have an open-plan ground floor. The kitchen speaker sits at head height, the
living room ones are across the floor, and when I group those rooms Sonos gives
them the same volume — which means the kitchen is shouting or the living room
is inaudible. So every time I grouped them, I fixed the balance by hand. Every
time.

That is the itch. A Sonos group is a snapshot of a decision: these rooms, right
now, at one volume. It has no memory of why you made it, so anything
that interrupts leaves you to put it back together yourself.

Sonos Smart Groups is my attempt at writing that down once instead.


The one that sold me on it

The home theater sits in the same open-plan space as the kitchen and the dining
room. Turn on the TV and this happens by itself:

  • the living room joins the home theater, Sub and all
  • the kitchen and dining room let go of it and pause
  • when the film ends, everything drifts back to where it was

That is two automations from the same blueprint. One marks the home theater as
superior and gives it a precedence lock; the other marks the ground-floor
music group as subordinate on the same lock, with rebuild when precedence
is released. No scripts, no snapshots, no room left behind in the wrong group
at midnight.

It also taught me the one thing I would not have guessed: rebuilding should not
use sonos.snapshot. Snapshots do not reliably restore group topology when the
speaker you snapshotted was already grouped — which is exactly the situation
precedence creates. So a smart group simply re-applies its own definition
instead. It knows what it should look like; that turns out to be all you need.


Where it fits

This does not replace grouping, stereo pairs, home theater sets or the new
zones feature — it sits on top of them. Those all bond speakers into a room:
a stereo pair, a home theater set with its Sub, a zone. Bonded speakers lose
their own names and stop being addressable. A smart group changes nothing about
that — it leaves your rooms as rooms and teaches them how to behave around each
other. Zones are permanent and set by hand; smart groups are conditional and can change with the time of day or whatever is playing.


Fair warnings

It has been running in exactly one house — mine. Some
things I already know about:

  • One direction per automation. Two rooms that follow each other need two
    automations with reciprocal factors. That constraint is deliberate: it is
    what makes the loop protection something I can actually reason about.
  • Because a group rebuilds itself from its own definition, groups you made by
    hand in the Sonos app are not preserved.
  • Equalizer copying needs the Sonos integration for the entities. With Music
    Assistant alone those options are skipped rather than broken.
  • Entity IDs are translated, so the equalizer had to be found another way — my
    own install is Dutch and calls bass ..._bas. It works in any language, but
    that is also why this is an integration and not a blueprint on its own.

I would genuinely like to hear whether the blueprint form makes sense to
someone who has not spent a fortnight thinking about it, and whether the
defaults hold up in a house that is not laid out like mine. Issues and pull
requests welcome, translations especially.