SmartThings Text-To-Speech for Sonos (playText) not working?

Looking into this. Seems to be a wider issue. I’ll update when I have something :smile:

Thanks, Tim! I’ve been seeing playText() oddities as well that I didn’t think were there in the past.

Tim,

This is the same issue you and I discussed this morning…

I fixed it myself by using tts-api.com to generate an MP3 link then just sending playTrack…

I have never heard of that, but that is kinda neat! I assume you use it like this "playTrack(“http://tts-api.com/tts.mp3?q=text to speak”)? I believe there is a parameter for duration that is required as well…do you account for that? Can you share a code snipit?

No duration required… I’m literally just doing exactly what you describe except I’m adding ‘&return_url=1’ to the tts-api URL. Make sure to url encode what you want to say to avoid bugs with special characters.

I guess that is the part that confuses me…are you ‘prestaging’ the url into a variable, essentially replacing the textToSpeech API? So instead of:

def text = "this is a test"
def url = textToSpeech(text, true)
playTrack (url.uri)

You would have something like:

def text = "this is a test"
def url = something to convert the tts-api to an uri
playTrack (url.uri)

or are you simple doing the following:

def url = "http://tts-api.com/tts.mp3?q=this+is+a+test&return_url=1"
playTrack (url)

If it is the last one, not sure why you would care to add the &return_url=1 to the end of it as the URL should just place the mp3 (or should…I am not in front of my Sonos to test this).

I’m using this as part of a custom API call, not directly in a smartapp, so it may not matter.

Ah…cool…thanks! I appreciate it…

Not to hijack this thread, but is there an easy way within groovy to send a URL like the TTS-API and capture the resulting text that would normally appear in the browser? I guess like a curl command? I looked at the httppost and httpget commands, but it almost appears they are expecting some sort of JSON to be returned. Anyway it is possible to catch the resulting url link with SmartThings?

@slagle - Is this something that’s going to be fixed soon, or is it a lower priority? I’ve got a project that hinges on playText working, so I don’t want to dump more time into it if there’s no fix in the pipeline.

Any idea when this will be fixed

1 Like

I’ve been having issues with sonos as well… As per support some combinations of words dont work… True ! When i use “leak detected” it fails to save page for a water sensor sonos voice notification. But when i write “water detected”, it saves…

Like I mentioned, it seems that phrases they have previously cached work, but new phrases do not.

@slagle

Any news? Is anyone working on this?

The last time I checked (2 hours back), the problem still exists. Haven’t heard of any update.

I’d really like to get this working.

@slagle Any update? Can you confirm at least where the problem is…i.e. Amazon, SmartThings, etc?

I have a ticket for this. No updates yet, but I can’t fix it :frowning:

I’ll go poke some people today.

5 Likes

Please do poke some people.
I’m finally getting a home audio solution in place using DLNA and Squeezebox renderers… I’d like to get things working with the notifications again.