Update: Added a YouTube device to search YouTube
Update: Added Volume Gain and Device Profile to CloudTTS device settings
Update: Added prefix-pause and suffix-pause to CloudTTS device settings (for Chromecast users)
Use the newest Google Cloud Services, starting with the new Text-to-Speech, Translate and YouTube.
See steps below for how to get the JSON.
YouTube
You can make a YouTube device and use it to search video’s.
Currently it will trigger the YouTube device trigger with the first found result.
More functionalities, like playing lists, will be added.
Translate
You can make a Google Translate device and use it as a condition to translate, of which the transalation will be available as a tokenvalue of the device.
Text-To-Speech
Useable with each device that takes an URL.
Cloud devices:
All languages that Google supports, are supported, because the settings are build from live data, so when a new language becames available, it will be for this App also.
You can set the Voice in the settings, but also within (certain) flowcards.
You can set Pitch, Speed, Volume Gain and Device Profile per device (will be overruled by flows with pitch and/or speed).
Also you can add a prefix and/or suffix pause in the device settings, which is particularly useful for Chromecast users:
A pause added the beginning will separate the notification sound and the actual speech.
SSML coding is accepted now, like: <speak>Here are <say-as interpret-as="characters">SSML</say-as> samples.<break time="3s" />. And continue</speak>
You get a URL for the audio that will be streamed through Homey, so the device eventually playing the mp3 file should be in the same network and have access.
The last 100 transcripts are stored in Homey’s Memory for speed and less requests to Google Cloud (restart of app or Homey means reset of memory).
Create a House device that triggers all applicable devices to say “Dinner is ready!” or just a device for the main room to say “The doorbell is ringing”.
You can add “devices” as many times as you would like, each with its own trigger.
Conditions are also available! You can let a flow wait in de condition till speech is finished before turning to the Then part of the flow.
This works great with other Apps like Sonos (Play Audio Clip (with volume)), Samsung Smart TV (Launch Browser with URL), Sonos Say (Url) and IFTTT.
How to get the Google Cloud Service Account (JSON)?
To use this app you will need to do the following:
- Create a Google Cloud account.
- Setup billing for your Google Cloud account
Learn how to confirm that billing is enabled for your project.
It is free, but setting up billing information is required for using Text-to-Speech - Enable the required two API’s at API Library - Google Cloud Platform
- Cloud Text-to-Speech
- Cloud Translate
- YouTube Data v3
- Create a service account - follow the steps below
- In the Cloud Console, go to the Create service account page.Go to Create service account
- Select a project.
- In the Service account name field, enter a name. The Cloud Console fills in the Service account ID field based on this name.In the Service account description field, enter a description. For example,
Service account for quickstart
. - Click Create .
- Click the Select a role field.Under Quick access , click Basic , then click Owner .
- Click Continue .
- Click Done to finish creating the service account.Do not close your browser window. You will use it in the next step.
Create a service account key:
- In the Cloud Console, click the email address for the service account that you created.
- Click Keys .
- Click Add key , then click Create new key .
- Click Create . A JSON key file is downloaded to your computer.
- Click Close .
Easiest way to enter the JSON in the settings would be throught the developer site: Homey Developer - App Settings.
Open the Google Service Settings and copy/paste the whole JSON text into the JSON field.
For YouTube you will need to generate an API key and set it in the App Settings
It’s free upto 4 million characters per month for non-Wavenet voices AND 1 million characters per month for Wavenet voices.
To see how many characters you have used up, goto the Google Cloud Console homepage, and to the right click on View detailed charges (the filter Group By SKU should be on)
As of release 1.6.3, if everything is set correctly, but during translation an error is given by Google Cloud, the message wil me given as notification.
Bandwidth excausted, meaning quota reached, is useally not about the monthly quota, but the minutes quota which you can set yourself in you own Google Cloud Console (account).
You can set the quota’s in the Google Cloud Console. You have to look for it. There are 2 global quota’s: 300 requests per minute, and 150.000 chars per minute.
BUT
There is also a 300 limit chars per minute during your trial account.
You can freelly upgrade to a full account, which will remove the 300 characters a minute and enforce the global 300req/p/m en 150k.char p/min.
Old Google TTS
There is the also old Google TTS device, with a max. 200 characters and limited options.
You do not need a Google Cloud account for that.
These languages are currently supported in Non-Cloud:
Engels (GB)
English (US)
Dutch (NL)
Dutch (BE)
German (DE)
German (LU)
French (FR)
French (BE)
Spanish (ES)
Italian (IT)
Swedish (SV)
Norwegian (NO)
Wanna play it on Homey itself?
Music Url Converter - Play Music URL’s on Homey bigger then 900 KB - Apps - Homey Community Forum (athom.com)
This works great voor a PA system:
How to make a Great Public Announcement ¶ System with any device! - Apps - Homey Community Forum (athom.com)
Step 1
Create a Google TTS Cloud Device.
In Homey, create a Device, select the Google Service App and then select the Text-ToSpeech device.
Step 2
Setup a trigger for the TTS Device with a actioncard that send the Url token to the device you want to hear to voice on.
Step 3
Start a speech condition/action (And or Then part) with a text (and it wil trigger the flow from step 2)