[APP][Pro] Sonos (LocalAPI)

I have suddenly started having issues with Azure TTS on my Homey. It has started stuttering; it begins speaking, says a few words, pauses, and then continues. This behavior started a few days ago.

I am using the Sonos (Local) app, and it has been working perfectly until now. When I use the built-in TTS in the Sonos app, it works fine, so the issue seems specific to the Azure integration. Has anyone else experienced this recently, or is there a known issue with the buffering between Azure and Sonos?

I also use the Sonos (local API) app with Azure TTS on my Homey 2026, and have recently experienced something similar. Sometimes the first few words are spoken, and then the TTS stops completely for the rest of the text. If I give the same command again, it plays correctly through Sonos. I haven’t discovered any regularity yet.

I restarted my Arc and then it started to work again

Hi @xiutit !

I have one more suggestion.

I see there are controls for the subwoofer:

I wonder if it would also be possible to add controls for a potential surroundspeaker setup linked to a soundbar. In the Sonos app I can see these controls, perhaps a bit niche but it would be great if we could change those from Homey dynamically! See:

Thank you!

This is so weird.

I just saw this topic and app for the first time.

And I find it very strange and funny: back in the day, about 4-5 years ago, there already was a community sonos app based on sonos-node, but it wasn’t allowed in the store because there was an official app for it :face_with_peeking_eye:.

We did so much work on that app back then :see_no_evil_monkey::man_facepalming:

Good to have a sonos-node app back! It will probably work much beter, stable and have more functionalities than the “official" one.

I haven’t tested this app yet, but nice work @dev as far as i read here!

Oh wow, I honestly didn’t know that! That’s actually quite surprising.

What I personally find a bit strange is that the official app doesn’t really match the idea of “local control over your devices.” I was genuinely surprised to discover that the Sonos app stops functioning when Homey has no internet connection.

Well, it by far is not as advanced as your app, just looking on the flowcards you have.

The bases was just to have Sonos say something (tts), but contained more options to control the sonos speakers. I updated it to version 3, which included some new functionality and easy install. But it was not accepted into the Homey Store at that time.

As far as I can remember your App is based on Node-Sonos-HTTP-API-Master and the main killer feature for me was the special function ‘sayall’, which first stored the current state of all speakers in a preset, grouped all the speakers together to one group, played the text, and then restored the original state of each speaker. All without any grouping and ungrouping via cards in homey flows.

Maybe an idea for the Sonos (LocalAPI) App :wink:

Ah you are using another node module? Didn’t know that.

I was more surprised that the Homey Store now allowed a community local app. But I think it’s great BTW!

And yeah, say all could be very nice.

I personally have complex flows since some it’s should just be in my living room while others are used everywhere and I ofc use my Google Services app for speech.

But if you follow the link I send, at the bottom there is a link to my repository. Feel free to use anything if it is of help to you :wink:

I’m sure I’ll be using you app once I am healthy again and have my HP26 SP up and running.

Hi and thanks for a great app! Works great!

Feature request: Play albums/playlists from music services (Apple Music, Spotify)

The “Play URL” card works for individual songs (e.g. x-sonos-http: URIs), but seems to fail with UPnP error 714 for albums and playlists (x-rincon-cpcontainer: URIs).

x-rincon-cpcontainer:1004206calbum%3a268284599?sid=204&flags=8300&sn=10

Sonos has a different UPnP method — AddURIToQueue — that handles albums and playlists when combined with DIDL-Lite metadata.

Would it be possible to add a flow card that uses AddURIToQueue instead? The node-sonos library already exposes this as addURIToQueue(options). It would unlock playing full albums and playlists from Apple Music, Spotify, etc. directly from Homey flows.

So maybe some new THEN-cards like “Enqueue and play” | “Replace and play” and even just “Enqueue”?

That would be awesome!
And it would basically free us from having to add a playlist as a sonos favourite to expose it to Homey.

Your app is way more advanced than the official app, but could you find a way to fix TTS to somehow work like the Sonos official app? and fix the AND charging card for Sonos Roam 2? (Note: i don’t know if my Sonos Roam 2 changing IP is the problem or if it is actually broken.)

Are you able to test v1.9.0? This version adds all these controls.

Is it somehow possible for you to make a flow card “play sound on Right/Left surround speaker”? There is a card that plays audio URLS, soundboard sounds, etc… But on my Sonos Beam Gen 2 i want them to play on the surround speakers. So for example getting audio from URL then it plays on either left/right or BOTH at the same time. Is this possible you think? @xiutit

Hi, I just tested the app.
Whenever I launch a URL using a flow, I always get the error shown. The “URL” command with volume in % does work, though. After that, however, the system can no longer be controlled.
I’m also experiencing these errors in the Athom app.
The command that uses only a URL works there, though.

The cards “Play at Volume” should only be used for announcements. These cards overlay the current stream with the file in the URL field on the specified volume. If you just want to play a stream URL you should use the seperate volume card to set the volume and then the “Play URL” card to play the stream.

OK, I see.
But as you can see in the screenshot above, the command “Play URL” returns an error message

Sorry, you are right. I think I’ve found what the issue is. The streams runs fine for me now. Are you able to test with v1.9.1? Sonos (LocalAPI) | Homey

Thank you so much, it’s working now.

Hi @xiutit, I am running into the following issue.

I have two Sonos systems. When I power on my second system and group it with the first one, that is already playing music, the second group also starts playing (the same) music, but the speaker state is not changed from paused/not playing to playing.

So Homey thinks the second system is not playing any music while it is. As a result, flows that depend on the player state do not work as expected.

Is that something you would be able/wanting to look into?

Interesting. What do you mean by two Sonos systems? Do you mean multiple rooms? If so, I should be able to test that, as I have quite a few rooms with Sonos.
If you mean multiple separate systems, that would be a bit more difficult for me to test.