Sonos - Speak text and restore


I use the above to make announcements, but find if something is already playing on the sonos, it does not resume after the text is spoken. This was the case on ST and also after migrating to HE.

Am I doing something wrong, or does this functionality not work?


Not sure this helps because I don’t have Sonos. But this worked with my echo. It spoke the text over the playing music.


Thats the same code I use to speak the text, so I guess it’s an issue with the sonos integration. I used to use a third party integration for the sonos speaks running on a raspberry pi, that also had the same issue with not resuming,

As an aside, what are you using for the echo integration? I used alexa speaks on ST, but thought that was no more


you should check what happens with the Sonos commands issued via the device tab in HE
(ie to prove it is the device).

If it is the device, you want to ask where they discuss that device handler in the HE forum.


Is there a way for WC to access the devices state variables? Theres a uri, which I could first read and then use to restore playback after the tts message. I can’t see how to access this, I can get the current states values using {([sonos : current attack})} , but not the uri state variable.


Can you show the screen shot of the device in question.

In, general the api for devices is commands and device attributes (device labels as ‘Current States’), normally ‘State Variables’ are not accessible to outside app access.

There is device data (under Device Details), that typically is used for physical device info.


The first screen shows the trackData current state which I can access. However, this does not work on “play track” as that just needs a url.

The second screen shows the uri state variable, that I can not access. However, I’ve just noticed that the uri does not get set to the streaming radio service url. (even with the radio playing, its still set to the tts file on the he hub) So even if I could access uri, I dont think I could code round the issue.


I use Echo Speaks, on HE, for all of my webcore/echo integration.


I suspect the issue is within the sonos api. It never worked on ST either, or on another 3rd party app. I dont think it works on home assistant either from what I can gather, but I cant see an option to speak & resume on there.

So… I need to code round this.
I’ve started looking and think I can get the data I need, however the data retrieved looks like json, but I cant extract data in the usual way. I’m wondering what I’m missing?