Update Required: New Sonos Integration

Yes, SharpTools can do audio announcements. TTS is a bit more tricky due to the changes made to the websocket DTH.

SharpTools has access to all of the methods that the new Sonos Websocket DTH exposes including playTrack() and related commands. The playText() method which performed text-to-speech with the previous Sonos DTH is no longer available in the Sonos Websocket DTH.

So there’s not a built-in TTS method directly on the driver anymore, but you can play any file that’s hosted on the web.

So one approach is to use a service like fromtexttospeech.com and then use the resulting file in the playTrack() method.

Create the TTS File

  1. Navigate to fromtexttospeech.com
  2. Enter in your desired phrase and tap Create Audio File
  3. (For testing purposes) Right-click the link of the resulting file and choose ‘Copy link address’

Note: I have no idea how long they keep the files hosted for you, so you’re probably better off downloading the file and storing it on Dropbox, Google Drive, etc. and then using a link directly to your stored copy of the file.

Create the Rule
(Assuming you already have your Sonos authorized in SharpTools)

  1. Open the SharpTools.io Rule Engine
  2. Tap Create Rule
  3. Under Flow, add a new ActionDevice
  4. Choose your Sonos device and select the playTrack() command
  5. Enter the URL to your TTS file in the first string argument
    Optionally: enter a target volume level for the number argument
    (or switch the ‘Advanced’ toggle on in the top-right corner and delete the number argument)

Note: In most cases, you’ll want to have some sort of Trigger defined in the rule otherwise the rule will never run.

4 Likes