After a recent update of the Sonos IDE the SpeakText function is no longer exposed in WebCore and while Play Text is is included in the Sonos IDE (dated 2015) Webcore does not expose it either. It appears that is a known effect and the majority of my announcements are no longer functional.
As a workaround I intend to use Amazon Polly (SynthesizeSpeech - Amazon Polly) for text to speech. When calling the API I get a response stating that the function is blacklisted. The code is as below and please note that the Christmas Tree Lights switch is simply used as a switch for testing so I can trigger it from my phone. Any thoughts or suggestions about how to get around the blacklisting would be very welcome. .
Try posting this over at https://community.webcore.co/
There are lots of Webcore experts over there that might be able to help you out as well as here.
Im almost positive you won’t work around this one without some major hoops. History lesson:
Back when SmartThings and Amazon were having problems with Echo Speaks they (Amazon) put something in place to prevent the Amazon apis form working when the call sourced from. ST servers. (it was never specified WHAT was put in place but they did intentionally break the API… We know that as fact) When you’re on WebCoRE in SmartThings, thats exactly where you’re running and where the calls will come from… This is also almost certainly why Tonesto wasn’t able to refactor the code to make a v2 without the polling issue as he wanted to.
Its only a guess, but id bet money you’re running into that very same block. If its true the only way you are working around it is to get the ‘call’ to not ‘source’ from SmartThings groovy servers. For instance build your smartapp using the new style smartapp using web services calls and AWS Lambda.
Thanks very much for the response and overview that gives a very good explanation of why I’m experiencing problems. I note too your idea about AWS but will pursue something different for a while. There are several firms that offer online text to MP3 through a web UI. I’m going to reach out to a couple and see if I can entice them to extend the service to an API. That would give me the ability to send a text string and get an MP3 back - which is what I wanted from Polly. I’ll provide an update when I get a sense as the whether this might be a potential approach. From a business perspective I would think that it would be a relatively small investment in development effort for them to see an increase in the usability of their existing service.