Trouble getting Sonos to play track or speak text


#1

1) Give a description of the problem
Not able to get Sonos to play a track or speak text when the fridge door is left open.

2) What is the expected behaviour?
When my fridge door sensor is “open”, would like a delay of 10 seconds. Then, send a push message to my phone and play audible alert over Sonos system (one speaker is fine for now). I would much prefer my alert to be spoken text “Close the fridge”, however a specific Spotify track would be an alternative. This should repeat every 10 seconds until the sensor state changes to “closed”.

3) What is happening/not happening?
I am reliably getting the push notifications as expected. Sonos changes the volume to the set level, then unsuccessfully attempts to play a track. Also, the “speak text” task is not available for me to choose, though I can see it in many other users pistons. Alerts stop when the sensor is closed, as expected.

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
9/16/2019, 10:55:05 AM +122ms
+1ms ╔Received event [Home].time = 1568652906191 with a delay of -1070ms
+122ms ║RunTime Analysis CS > 35ms > PS > 57ms > PE > 30ms > CE
+125ms ║Runtime (38010 bytes) successfully initialized in 57ms (v0.3.10f.20190822) (122ms)
+127ms ║╔Execution stage started
+128ms ║╚Execution stage complete. (2ms)
+130ms ╚Event processed successfully (130ms)
9/16/2019, 10:54:58 AM +439ms
+1ms ╔Received event [Sensative Strips].contact = closed with a delay of 94ms
+60ms ║RunTime Analysis CS > 17ms > PS > 27ms > PE > 16ms > CE
+63ms ║Runtime (38007 bytes) successfully initialized in 27ms (v0.3.10f.20190822) (60ms)
+63ms ║╔Execution stage started
+71ms ║║Comparison (enum) closed is (string) open = false (2ms)
+72ms ║║Cancelling condition #2’s schedules…
+73ms ║║Condition #2 evaluated false (6ms)
+74ms ║║Cancelling condition #1’s schedules…
+75ms ║║Condition group #1 evaluated false (state changed) (8ms)
+77ms ║╚Execution stage complete. (14ms)
+78ms ╚Event processed successfully (78ms)
9/16/2019, 10:54:56 AM +56ms
+0ms ╔Received event [Home].time = 1568652897585 with a delay of -1530ms
+64ms ║RunTime Analysis CS > 15ms > PS > 30ms > PE > 19ms > CE
+66ms ║Runtime (38002 bytes) successfully initialized in 30ms (v0.3.10f.20190822) (65ms)
+67ms ║╔Execution stage started
+77ms ║║Cancelling statement #7’s schedules…
+95ms ║║Executed virtual command sendPushNotification (14ms)
+98ms ║║Cancelling statement #9’s schedules…
+109ms ║║Executed physical command [Kitchen].setVolume([40]) (7ms)
+110ms ║║Executed [Kitchen].setVolume (7ms)
+118ms ║║Executed physical command [Kitchen].playTrack([https://open.spotify.com/track/04KTF78FFg8sOHC1BADqbY]) (4ms)
+119ms ║║Executed [Kitchen].playTrack (6ms)
+127ms ║║Condition #4 evaluated false (6ms)
+128ms ║║Condition group #3 evaluated false (state did not change) (7ms)
+130ms ║║Cancelling statement #5’s schedules…
+133ms ║║Executed virtual command wait (1ms)
+134ms ║║Requesting a wake up for Mon, Sep 16 2019 @ 10:55:06 AM MDT (in 10.0s)
+138ms ║╚Execution stage complete. (72ms)
+140ms ║Setting up scheduled job for Mon, Sep 16 2019 @ 10:55:06 AM MDT (in 9.996s)
+152ms ╚Event processed successfully (152ms)
9/16/2019, 10:54:47 AM +475ms
+1ms ╔Received event [Sensative Strips].contact = open with a delay of 89ms
+87ms ║RunTime Analysis CS > 29ms > PS > 42ms > PE > 17ms > CE
+89ms ║Runtime (38012 bytes) successfully initialized in 42ms (v0.3.10f.20190822) (87ms)
+90ms ║╔Execution stage started
+98ms ║║Comparison (enum) open is (string) open = true (2ms)
+99ms ║║Cancelling condition #2’s schedules…
+100ms ║║Condition #2 evaluated true (6ms)
+101ms ║║Cancelling condition #1’s schedules…
+102ms ║║Condition group #1 evaluated true (state changed) (8ms)
+105ms ║║Cancelling statement #5’s schedules…
+108ms ║║Executed virtual command wait (0ms)
+110ms ║║Requesting a wake up for Mon, Sep 16 2019 @ 10:54:57 AM MDT (in 10.0s)
+114ms ║╚Execution stage complete. (24ms)
+115ms ║Setting up scheduled job for Mon, Sep 16 2019 @ 10:54:57 AM MDT (in 9.995s)
+124ms ╚Event processed successfully (124ms)


#2

Your log looks good.
It seems your focus should only be on line 28, where you attempt to play Spotify.

Perhaps this old thread will be of assistance.


#3

Thanks for the reply and suggestion, WCmore! I did stumble upon that thread in my research before posting, but it seems something with Sonos integration may have changed over the last 18 months because that route is not working for me. The webCoRE dialogue asks for a “track URL”, and I’ve tried both the URL and the URI with no success.

Also, any ideas why I would not have “speak text” as an option to choose for the task? I was able to get the SmartThings app to speak text to Sonos, but cannot figure out how to do it through webCoRE.


#4

While I’m still very interested in making webcore speech to text work on Sonos, I found a workaround that will do. I used a free speech to text generator online that allowed me to download an mp3. I then uploaded this mp3 to Google Drive. Then, I used the instructions at the link below to get a direct link to the file that I plugged into the Track URL field within the Play Track task.

Google Drive shared URL (Step 1)


Google Drive direct link (Step 2)


#5

I’m curious, (sonos user btw) ddid you try your URL link in a regular browser to see if mp3 file you have is playing?

I don’t rely much on speak text but all most my commands are playtrack and they work perfectly. Almost with 99% accuracy.


#6

Hi ike2018 - I did not try that with a Spotify track URL, but it’s a good suggestion. My mp3 of spoken text from the voice generator is working when plugged into a browser. Are you using playtrack with a URL to a spotify track successfully?

Thanks!


#7

This might be related to the latest Sonos/smartthings update. I think some updates on the webcore side is needed for TTS to work.


#8

I tried Spotify but I couldn’t get the music list, I could only get single tracks and works well.


#9

Is there any resolution for this problem being discussed? I just deleted the Sonos speakers to use the new Smartthings Sonos integration without realizing there is no way back. Now my voice announcements via webCoRE are broken… This was a nice feature…


#10

I switched to using Jishi Sonos HTTP API together with Azure TTS service. Works great so far. I am running Jishi’s code on a raspberry pi. I think there are more options with this code and Azure TTS has some cool voices to use :slight_smile:

I don’t think anyone on the Webcore side is actively working to integrate Sonos TTS using the new Smartthings API.