Google Cloud
The Google Cloud integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows you to use Google Cloud Platform APIs and integrate them into Home Assistant.
Configuration
To add the Google Cloud service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Google Cloud.
-
Follow the instructions on screen to complete the setup.
Obtaining service account file
-
Visit Cloud Resource Manager.
-
Click
CREATE PROJECTbutton at the top. -
Specify convenient
Project nameand clickCREATEbutton. -
Make sure that billing is enabled for your Google Cloud Platform project.
-
Enable needed Cloud API visiting one of the links below or APIs library, selecting your
Projectfrom the dropdown list and clicking theContinuebutton: -
Set up authentication:
-
Visit this link
-
From the toolbar above the
Service accountlist, selectCreate service account. -
In the
Service account namefield, enter any name.If you are setting up text-to-speech:
- Don’t select a value from the Role list. No role is required to access this service.
- Click
Create. If a note appears, warning that this service account has no role, you may ignore that. - Return to the
Service accountlist page and click on the service account you created to see the details for this service account. - Choose the
Keystab within the details view for this service account. - In the
Add Keydropdown, selectCreate New Key. - Specify a
JSONkey type and clickCreate. - A
[serviceaccountname].jsonfile will download to your browser. - Upload this file when asked in the integration setup.
-
Google Cloud text-to-speech
Google Cloud text-to-speech converts text into human-like speech in 380+ voices across 50+ languages and variants. It applies groundbreaking research in speech synthesis and Google’s powerful neural networks to deliver high-fidelity audio. With this easy-to-use API, you can create lifelike interactions with your users that transform customer service, device interaction, and other applications.
Pricing
The Cloud text-to-speech API is priced monthly based on the number of characters to synthesize into audio sent to the service. For up-to-date pricing, see here.
Text-to-speech configuration
The following settings can be configured in the integration options and in the Options field of the Speak action.
Configuration Variables
Default audio encoding. For supported values, see the Google Cloud text-to-speech API reference.
Default volume gain, in decibels. Supported values range from -96.0 to 16.0. If unset, or set to a value of 0.0 (dB), it plays at normal native signal amplitude. A value of -6.0 (dB) plays at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) plays at approximately twice the amplitude of the normal native signal amplitude. We strongly recommend not to exceed +10 (dB), as there’s usually no effective increase in loudness for any value greater than that.
Default voice gender. For supported voices and genders, see the Google Cloud text-to-speech voices documentation.
Default language of the voice, for example, en-US. For supported languages, see the Google Cloud text-to-speech voices documentation.
Default pitch of the voice. Supported values range from -20.0 to 20.0.
Default audio profiles to apply. For supported values, see the Google Cloud audio profiles documentation.
Default speaking rate of the voice. Supported values range from 0.25 to 4.0.
Default text type. Use text or ssml. For more information, see the Google Cloud SSML documentation.
Default voice name, for example, en-US-Wavenet-F. This overrides language and gender when set. For supported voices, see the Google Cloud text-to-speech voices documentation.
Using Google Cloud text-to-speech in automations
To play a message from an automation or script, use the Speak action and select your Google Cloud text-to-speech entity as the target.
To speak a message from an automation or a script:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create automation > Create new automation.
- If you are setting up a new automation, add a trigger in the When section. Scripts do not need a trigger. They run when something else calls them.
- In the Then do section, select Add action.
- Select what you want to control. Under By target, select your Google Cloud text-to-speech entity.
- From the actions shown for that target, select Speak. To use Google Cloud-specific settings, set them in Options. For supported options, see Text-to-speech configuration.
- Select the Media player entity to play the message on, set the Message, and set any other options you want to use.
- Select Save.
If you still use the legacy Google Cloud text-to-speech platform in configuration.yaml, use the Say a TTS message action. In YAML, the legacy Google Cloud action is tts.google_cloud_say.
Google Cloud speech-to-text
Google Cloud speech-to-text converts audio into text transcriptions for 125 languages and variants.
Pricing
Speech-to-text is priced based on the amount of audio successfully processed by the service each month, measured in increments of one second. For up-to-date pricing, see here under the Speech-to-text v1 API.
Speech-to-text configuration
Configuration Variables
One of the transcription models here. Defaults to latest_short because this is the recommended one. If you get: 400 Invalid recognition 'config': The requested model is currently not supported for language : <language code> try changing this to the legacy command_and_search.