I’ve owned Sonos speakers for several years and lived through the horror of the Sonos app overhaul. I’ve used Home Assistant for a similar length of time, and I only just realized how well the two work together.
What Home Assistant exposes for Sonos speakers
Easier control than using the app
I’ve had the Sonos integration installed in Home Assistant for as long as I can remember. I knew that it was exposing my Sonos speakers as media players, but I hadn’t looked any closer at what else was exposed. This is one of the problems with Home Assistant; there’s so much that it can do that you often install an integration and then completely forget to do anything with it, as you’re busy using some of the other integrations you installed at the same time.
It was only recently that I spotted the Sonos integration in my list and had a closer look at what entities and controls it exposed. There was a lot more than I expected.
You get number, select, or switch entities to control bass, treble, loudness, crossfade, alarms, the status light, and touch controls. There are also actions for playing music, getting the current queue, joining speaker groups, and more.
If you have Sonos home theater devices, there are extra controls for things such as Night Sound, Speech Enhancement, Surround Level, and Audio Delay. Using Home Assistant to change some of these Sonos settings is far easier than diving into the official app.
TTS announcements that don’t break the flow
Please don’t stop the music
One of the best features of the Sonos integration is something that I was completely unaware of. Since the Sonos speakers are exposed as media players, I’ve been using them for a long time as a way to play audio announcements.
Reading through the integration documentation, I discovered that there was a very useful argument called announce. By setting announce to true, when you send a text-to-speech (TTS) or audio file to the Sonos while music is playing, it doesn’t stop the music. Instead, it lowers the volume and plays the announcement over the top, so that the music isn’t interrupted.
There’s also a sonos.snapshot action that you can use to capture what is currently playing on the Sonos speaker. You can then pause the music to make announcements and resume from the same place using the sonos.restore action.
Music Assistant makes Sonos speakers even better
Play music from any source
I’ve been using Music Assistant for a while as my main method of playing music in my home. It’s a great way to access all of my music, including music from streaming services such as Spotify and Apple Music, as well as music I have stored locally. There’s a Sonos player provider that lets you stream music from Music Assistant to Sonos speakers.
Sonos speakers are auto-detected by Music Assistant, so it’s easy to add them. If you have multiple Sonos speakers, you can group them and have them all play the same music in sync.
What’s great about Music Assistant is that I can access music from all of my sources, including my local music files, and easily transfer music from one speaker to another. I don’t have to wade through the Sonos app to find the music I want to play; I can control everything from Music Assistant without touching the Sonos app at all.
Creating automations with Sonos speakers
There’s a lot you can do
One of the best things about using Home Assistant with Sonos speakers is that you can use them in automations. I’d already been using them for spoken announcements, but now I’ve been able to improve those announcements by having the music duck slightly when they’re played.
Combining the Sonos speakers, Music Assistant, and presence sensors, I can play music on the Sonos speaker in the dining room, then move to the living room, and have the music continue on the Sonos speaker in there, automatically turning off in the dining room. If I return to the dining room, the music stops playing in the living room and carries on in the dining room instead, making me feel like I’m living in the future.
I can also do things such as automatically lowering the volume after the kids have gone to bed, stopping the speakers when everyone has left the house, and having specific playlists start when we all sit down to eat in the dining room.
My Sonos speakers are more useful than ever
Home Assistant is so packed with features that it’s easy to miss some of the best features of integrations that you already use. Discovering the capabilities of the Sonos integration that I’d been missing out on has made me want to take a closer look at some of the other integrations I’ve been using for years.
