Download Now How To Setup Source Tips Top

Hello RenoTTS:

A new simple, redundant solution to TTS on SmartThings utilizing Amazon's Polly.
  • Please note: RenoTTS is currently beta.
  • Completely free and open source.
  • Easy install on many unix-based configurations.
  • Easy setup with baked in redundancy.
  • Complete package: all that's required is AWS Polly Credentials.

That sounds good...

But what's it do... and redundant?
Redunancy is built in. There are very few setup requirements. The application itself is built to be as easy as possible to install and configure, while allowing configuration options for those who prefer them.

RenoTTS is a solution in 3 parts:

Let us do the talking!

Alright, I'm in!

So, how do I use it?

"Total cost: ~$30 for a C.H.I.P. setup and guess what? It's been rock solid."

First, a little backstory:

I'm a tinkerer, I love to play. SmartThings is great for that. What's missing? The ability to say "Garage Door Open", or "Amy Has Arrived Home" simply, from any app, and cheap.

My search for the best TTS solution brought me to many lands, and back from some, some were good.

The day I discovered Amazon Polly's "Joanna" voice, I knew THAT should be the voice of my home. So I created RenoTTS. Well, a hacked together version, and I've been using it for almost a year on RasPi's and NextThing C.H.I.P.'s plugged into cheap Amazon Basics speakers throughout my home. Total cost: ~$30 for a C.H.I.P. setup and guess what? It's been rock solid.

My Requirements:

My requirements were simple. I wanted something that could be up and running in a matter of minutes, utilize any of the Polly voices, and most importantly... not fail to speak! For that reason the solution needed to have redundancy baked in.

I built RenoTTS to meet these requirements. I really wanted to provide a solid TTS solution for SmartThings that was simple and easy enough to configure that most people could do it without 'too much' hassle. I also wanted it to 'just work', I don't want to configure speakers on a regular basis, or figure out why we're not speaking today. I just want to set them up and have them work reliably. THAT is RenoTTS.

Alrighty, so...

how do I use it?

"It's pretty easy, the hardest part is setting up AWS Credentials if you haven't already."

Getting Amazon Polly Credentials:

This is the hardest part. If you already have Amazon access keys (not username/password), go ahead and skip to 'Installing Amazon Credentials'.

Step 1: If you haven't already done so, set up an account with AWS. Don't worry, it's free for the first year.

Step 2: Navigate to Amazon IAm and log in if needed.

Step 3: Select 'Groups' from the left column, then click 'Create New Group'.

Step 4: Give your group a name (E.G. RenoTTS), then click 'Next Step' in the bottom right corner.

Step 5: Place a check mark next to the "AmazonPollyReadOnlyAccess" policy for this group, then click 'Next Step'.
(It helps to type the word 'polly' in the filter box so you don't have to scroll through the entire list.)

Step 6: Review and create this group.

Step 7: Select 'Users' from the left column, then click 'Add User'.

Step 8: Give the User a name (E.G. RenoTTSUser), then check the box for "Access type, Programmatic access". Click 'Next:Permissions'

Step 9: On the permissions page, check the box next to the group we created previously, then press 'Next:Review'

Step 10: On the review page, select 'Create User'. You will be brought to a page that shows the user and access keys. Keep this page handy in your browser.

Installing Amazon Credentials:

This should be done for each new PC or SBC you wish to add as a RenoTTS speaker. They can all share the same keys if you wish.

Step 1: Create the proper directory.

mkdir ~/.aws

Step 3: Create the credentials file (1 of 2) and paste in the following: Note: If you wish to create a custom profile just for Polly (aside from default), do so by ensuring the profile exists in both credentials and config, then change the aws-config-profile setting in ~/.renotts/renotts.toml.

nano ~/.aws/credentials

[default]
aws_access_key_id = |Your Access Key ID, See Above|
aws_secret_access_key = |Your Secret Access Key, See Above|

Step 4: Determine your region by looking at this chart: Select Closest

Step 5: Create the config file (2 of 2) and paste in the following:

nano ~/.aws/config

[default]
region=|your region, E.G. us-west-2|
output=json
        

Setting Up The RenoTTS Application:

Step 1: Decide where to store the file. Note: While you can store the server in /usr/bin or /bin, it's simpler to just plop it into your home directory. Don't worry, you can still start on boot!

mkdir ~/renoTTS
cd ~/renoTTS

Step 2: Install the dependancies.

sudo apt-get update && sudo apt-get install -y portaudio19-dev libmpg123-dev

Step 3: Determine the proper download for your system architecture.

Step 4: Download and extract the files.

wget http://download.renotts.com/renotts.<version>.<arch>.tar.gz
tar -xvzf renotts.<version>.<arch>.tar.gz

Step 5: Make executable, then run the server.

sudo chmod +x renotts
./renotts
RenoTTS: * found required AWS config file: /home/dustin/.aws/config
RenoTTS: * found required AWS config file: /home/dustin/.aws/credentials
RenoTTS: * RenoTTS Configuration file loaded: /home/dustin/.renotts/renotts.toml
RenoTTS: * execPlayer not set, will play files internally
RenoTTS: * Instructions/Options: visit http://192.168.1.70:46093 in a browser.

Configuration now lives in the .renotts folder in your home directory.
Visit the URI provided in a browser to check config, test the server, and get detailed boot configuration instructions.

Step 6: That's the simple bare-bones setup. You're ready to set up SmartThings.

If you wish to configure other options, please locate the renotts.toml configuration file in the folder .renotts in your home directory.
This file was automatically generated when the server started.

Installing the Device Type:

Step 1: Navigate to the SmartThings IDE. Log in, select 'My Locations', then click the name of your hub.

Step 2: Select 'My Device Handlers'.

Step 3: If you haven't already done so, enable github integration by following the official instructions: Enable Github Integration.

Step 4: Press 'Settings' in the upper right corner.

Step 5: In the window that pops up, select 'Add New Repository'. In the 3 boxes, type the following (case sensitive), then press 'Save':

Owner:Dustinmj
Name:SmartThings-RenoTTS
Branch:master

Step 6: Select 'Update From Repo' and choose 'SmartThings-RenoTTS-Handler (master)', click the box labeled 'Publish', then press 'Execute Update'.

Step 7: Your device handler should be installed. Proceed to installing the app.

Installing the 'SmartApp':

Step 1: Navigate to the SmartThings IDE. Log in, select 'My Locations', then click the name of your hub.

Step 2: Select 'My SmartApps', then press 'Settings' in the upper right corner.

Step 3: In the window that pops up, select 'Add New Repository'. In the 3 boxes, type the following (case sensitive), then press 'Save':

Owner:Dustinmj
Name:SmartThings-RenoTTS
Branch:master

Step 4: Select 'Update From Repo' and choose 'SmartThings-RenoTTS-Connect (master)', click the box labeled 'Publish', then press 'Execute Update'.

Step 5: Your 'SmartApp' should be installed. You're ready to go!

Putting it all together:

Step 1: From the SmartThings mobile application, click Automation>SmartApps>Add a SmartApp.

Step 2: Navigate to the bottom of the list and choose '+My Apps'.

Step 3: Find RenoTTSConnector and follow the instructions. The app will locate and install your RenoTTS servers.

Now fall in love with RenoTTS!

Tips and Tricks

Device Agnostic Tips

  1. For internal audio playing, RenoTTS uses the PortAudio library.
  2. On startup, RenoTTS creates a configuration file at ~/.renotts/renotts.toml if one does not exist. If you run into configuration issues, simply delete this file and RenoTTS will reset to defaults.
  3. The RenoTTS configuration file contains an option for 'exec-player'. This allows you to choose any other cli mp3 player (e.g. mplayer, mpg123, etc) to play files instead of RenoTTS attempting to play them internally. This is helpful for a myriad of issues that may come up with PortAudio.
  4. The port that RenoTTS listens on can be set via the configuration file. This becomes useful when you wish to query your server directly or use the integrated tester.
  5. RenoTTS contains an integrated test page. To use: simply start the server and open the URI that was output to the terminal in a browser.
  6. RenoTTS writes a useable service file to ~/.renotts upon starting the server. For instructions on installing the service (start on boot), simply start RenoTTS and visit the address that was output to the terminal. This will give you instructions specfic to your setup. It's Easy!
  7. You can change your TTS voice from the SmartThings device settings page at any time! Change it every day of the week if you wish! This doesn't affect your other SmartApp logic or setups.
  8. For tight control over PortAudio, if using Alsa. You can create a custom device/plugin in ~/.asoundrc or /etc/asound.conf labeled "renotts". RenoTTS server will then prefer this device. This is rarely needed, but could be helpful if the default device is not cooperating.

Specific to Raspberry Pi

  1. Due to sdcard latency, allowing PortAudio to decide buffer size can result in underruns in the hardware driver. To remedy: set the "force-portaudio-buffer-size" RenoTTS configuration option to approximately 30000-40000 for best sound quality. Don't forget to uncomment the option and restart RenoTTS.
  2. As is typical of Pi, sound through the audio jack port is good but not amazing. For better sound consider a hat or usb adapter.
  3. If you wish to move the sound cache directory to another location, do so using the RenoTTS 'cache-path' configuration option.

Specific to NextThings C.H.I.P.

  1. CHIP may have a delay before playing audio, which will cut off the beginning of (or all of) speech. To remedy, use the "Pad with Silence">"Before" option from the settings menu in your SmartThings device page. This will play 1-2 seconds of silence to allow the audio drivers to be initialized prior to playing speech audio. Win!

Downloads

It's Easy!

Current Version: 1.0 beta 2.2

Repositories

The Source.

How do I build it?

Don't see a pre-built for your device?

Step 1: This assumes you already have a Go environment configured.

Step 2: Install the dependancies.
sudo apt-get update && sudo apt-get install -y portaudio19-dev libmpg123-dev

Step 3: Get the repo and Go dependancies (this may take a few minutes)

go get github.com/dustinmj/renotts

Step 4: Build it

go build github.com/dustinmj/renotts

Step 5: The renotts binary will be created in the current directory.