Speak to Sonos not working properly/Random


#1

1) Give a description of the problem
I having random speak issue from Webcore to my Sonos system.

2) What is the expected behavior?
I expect the voice to trigger on one or several of my Sonos Speakers

3) What is happening/not happening?
The WebCore logging says that it is triggering the Speak and Resume or just Speak but nothing is coming out. This is random because some other Pistons work.

Example of one that says it played but it didn’t -

|+354ms|║║Executed physical command [Kitchen Sonos].setLevel([100]) (30ms)|
|+355ms|║║Executed [Kitchen Sonos].setLevel (31ms)|
|+381ms|║║Executed physical command [Pool Sonos].setLevel([100]) (23ms)|
|+382ms|║║Executed [Pool Sonos].setLevel (24ms)|
|+600ms|║║Executed physical command [Kitchen Sonos].playText([Star Lord Has Arrived]) (214ms)|
|+601ms|║║Executed [Kitchen Sonos].playText (216ms)|
|+807ms|║║Executed physical command [Pool Sonos].playText([Star Lord Has Arrived]) (204ms)|
|+808ms|║║Executed [Pool Sonos].playText (206ms)|
|+812ms|║╚Execution stage complete. (560ms)|
|+813ms|╚Event processed successfully (813ms)|

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)
Logs above


#2

SpeAk resume doesn’t work for me. Also if you send too much text it won’t play it. Also, if there are any \n in the text it will balk too.


#3

I love your piston Star Lord:))))

I do not have an answer to your problem BUT, 2 days ago my sonos system (4 of them) started having a problem with TTS. Nothing was happening. Logs would say it worked but I was not hearing it. Couple of hours later even playing mp3 play track stopped working.

Somewhere on the internet I saw a guy who deleted all the speakers, reset the sonos system, installed it again and he said it worked for him. I did the same thing last night. Nothing happened. Today I started playing with variables, speak text… Speak restore…speakresume… but an hour ago, I just tried simple:
Set volume to 50
Speak text I am back

and it worked.

So my understanding is. Sonos systems are not entirely reliable but you have to play around to make it work. What works today may not work tomorrow. Hopefully sonos people will wake up and see that this is a problem and come up with either device handler or something else.

Im already telling people if they are interested in automation (without pressing buttons on sonos app) stay away from sonos.


#4

Thanks, what odd is that same as you very simple text to voice works ok but when I have too much text or if I use complex variables it doesn’t seem to work. Maybe I will try to remove and re-add. Are we sure that it this is not a Webcore issue?


#5

Hi @temps76.
In my case after remove and re-ad only solved part of the problem. I still had to keep my text really short.
Well it could be Webcore problem but when I tried with Speaker companion (or what ever the name was) still got no sound.
I am wondering if there are any other speakers that work really well with ST and webcore.


#6

If you have a computer running on your network capable of running nodejs, this works really well:
https://github.com/jishi/node-sonos-http-api


#7

Hey @alltrak
I will definetly look into this. Just a quick question thought, would this help only with text or also variables?
" Good morning, the weather is (Variable) today" for instance?


#8

Here’s a simple example, which executes perfectly. Also, the “portable play1” is a grouped speaker. The piston executes, speaks the text just on “portable play1” and then goes back to what it was doing.

The speaker says “Your test switch is on” (or off depending on state).


#9

Here’s another example.

And I don’t think it matters whether you post with form or json. The URL simply triggers it, there’s actually no data being “posted”

EDIT: I define my variable “speak” in the expression editor so you can see what it’s doing. It’ll handle variables. You may just need to escape them in the string with single-quotes. Like the above example.


#10

Sorry for a newby question but can I use nodejs with ST hub?? Or the two has got nothing to do with each other?? I can install nodejs to my comp. and works directly with webcore?

Thank you for the examlpe piston, it helps a lot.


#11

nodejs is used to run the node-sonos-http-api. These have zero to do with ST.
When you configure and run the node-sonos-http-api, it just sits there and listens for URL requests and when it gets them, it processes those and sends the commands directly to your sonos speakers.

So forget ST and webcore for a minute… Once you have nodejs running node-sonos-http-api, you can test it by simply using a web browser and sending URL requests to your nodejs instance.

In my examples above, I’m running node-sonos-http-api on a local server located at 192.168.1.231 and node-sonos-http-api is listening on port 5005.

Make sense?


#12

Absolutely…Makes perfect sense… Thank you so much.
Basicaly its a local server. I used to do that (20 years ago:)))) to host my own html website… (Everything was called something else back then:)))
Its the same thing.

Thanks a lot… I am on it.