VOOZH about

URL: https://www.home-assistant.io/integrations/google_translate

⇱ Google Translate text-to-speech - Home Assistant


The Google Translate text-to-speech integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] uses the unofficial Google Translate text-to-speech engine to read text with natural-sounding voices. Despite the name, the integration only does text-to-speech and does not translate the messages you send to it.

Configuration

To add the Google Translate text-to-speech service to your Home Assistant instance, use this My button:

👁 Image

Check the complete list of supported TLDs for allowed TLD values. This is used to force the dialect when multiple dialects fall into the same 2-digit language code (for example, US, UK, or AU).

You can also use supported BCP 47 tags or the 2-2 digit format for your supported dialect (en-gb or en-us). The currently implemented mappings are:

Dialect Language TLD
en-us en com
en-gb en co.uk
en-uk en co.uk
en-au en com.au
en-ca en ca
en-in en co.in
en-ie en ie
en-za en co.za
fr-ca fr ca
fr-fr fr fr
pt-br pt com.br
pt-pt pt pt
es-es es es
es-us es com

Action: Speak

The tts.speak action is the modern way to use Google Translate text-to-speech. Add the speak action, select the entity for your Google Translate text-to-speech (it is named for the language you created it with), select the media player entity or group to send the TTS audio to, and enter the message to speak.

For more options about speak, see the Speak section on the main TTS building block page.

In YAML, your action will look like this:

action: tts.speak
target:
 entity_id: tts.google_en_com
data:
 media_player_entity_id: media_player.giant_tv
 message: "Hello,canyouhearmenow?"

Action: Say (legacy)

Tip

The google_translate_say action can be used when configuring the legacy google_translate text-to-speech platform in configuration.yaml. We recommend that new users instead set up the integration in the UI and use the tts.speak action with the corresponding Google Translate text-to-speech entity as the target.

The google_translate_say action supports language and also options for setting tld. You set the text to speak with the message option. The action name can be customized with the service_name configuration option.

Say to all media_player device entities:

# Replace google_translate_say with <platform>_say when you use a different platform.
action: tts.google_translate_say
data:
 entity_id: all
 message: "Maytheforcebewithyou."

Say to the media_player.floor device entity:

action: tts.google_translate_say
data:
 entity_id: media_player.floor
 message: "Maytheforcebewithyou."

Say to the media_player.floor device entity in French:

action: tts.google_translate_say
data:
 entity_id: media_player.floor
 message: "Quelaforcesoitavectoi."
 language: "fr"

Say to the media_player.floor device entity in UK English:

action: tts.google_translate_say
data:
 entity_id: media_player.floor
 message: "Maytheforcebewithyou."
 language: "en-uk"
action: tts.google_translate_say
data:
 entity_id: media_player.floor
 message: "Maytheforcebewithyou."
 language: "en"
 options:
 tld: co.uk

With a template:

action: tts.google_translate_say
data:
 message: "Temperatureis{{states('sensor.temperature')}}."
 cache: false

For more information about using text-to-speech with Home Assistant and more details on all the options it provides, see the TTS documentation.

Help us improve our documentation

Suggest an edit to this page, or provide/view feedback for this page.