mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-17 14:26:51 +00:00
Add google translate config flow (#27886)
This commit is contained in:
parent
284642c81a
commit
8d69ce3002
@ -8,33 +8,13 @@ ha_iot_class: Cloud Push
|
|||||||
ha_domain: google_translate
|
ha_domain: google_translate
|
||||||
ha_platforms:
|
ha_platforms:
|
||||||
- tts
|
- tts
|
||||||
|
ha_config_flow: true
|
||||||
ha_integration_type: integration
|
ha_integration_type: integration
|
||||||
---
|
---
|
||||||
|
|
||||||
The `google_translate` text-to-speech platform uses the unofficial [Google Translate text-to-speech engine](https://translate.google.com/) to read a text with natural sounding voices. Contrary to what the name suggests, the integration only does text-to-speech and does not translate messages sent to it.
|
The `google_translate` text-to-speech platform uses the unofficial [Google Translate text-to-speech engine](https://translate.google.com/) to read a text with natural sounding voices. Contrary to what the name suggests, the integration only does text-to-speech and does not translate messages sent to it.
|
||||||
|
|
||||||
## Configuration
|
{% include integrations/config_flow.md %}
|
||||||
|
|
||||||
To enable text-to-speech with Google, add the following lines to your `configuration.yaml`:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# Example configuration.yaml entry
|
|
||||||
tts:
|
|
||||||
- platform: google_translate
|
|
||||||
```
|
|
||||||
|
|
||||||
{% configuration %}
|
|
||||||
language:
|
|
||||||
description: "The default speech language to use."
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: "`en`"
|
|
||||||
tld:
|
|
||||||
description: "The default Google domain you want to use to choose dialect."
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: "`com`"
|
|
||||||
{% endconfiguration %}
|
|
||||||
|
|
||||||
Check the [complete list of supported languages](https://translate.google.com/intl/en_ALL/about/languages/) (languages where "Talk" feature is enabled in Google Translate) for allowed values.
|
Check the [complete list of supported languages](https://translate.google.com/intl/en_ALL/about/languages/) (languages where "Talk" feature is enabled in Google Translate) for allowed values.
|
||||||
Use the 2-digit language code which you can find at the end of the URL when you click on the language name.
|
Use the 2-digit language code which you can find at the end of the URL when you click on the language name.
|
||||||
@ -60,21 +40,14 @@ You can also use supported BCP 47 tags like the below or the 2-2 digit format fo
|
|||||||
|es-es|es|es|
|
|es-es|es|es|
|
||||||
|es-us|es|com|
|
|es-us|es|com|
|
||||||
|
|
||||||
|
|
||||||
## Full configuration example
|
|
||||||
|
|
||||||
A full configuration sample including optional variables:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# Example configuration.yaml entry
|
|
||||||
tts:
|
|
||||||
- platform: google_translate
|
|
||||||
language: "de"
|
|
||||||
tld: com
|
|
||||||
```
|
|
||||||
|
|
||||||
## Service say
|
## Service say
|
||||||
|
|
||||||
|
<div class='note'>
|
||||||
|
|
||||||
|
The `google_translate_say` service can be used when configuring the legacy `google_translate` text-to-speech platform in `configuration.yaml`. We recommend new users to instead set up the integration in the UI and use the `tts.speak` service with the corresponding Google Translate text-to-speech entity as target.
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
The `google_translate_say` service supports `language` and also `options` for setting `tld`. The text for speech is set with `message`. Since release 0.92, the service name can be defined in the configuration `service_name` option.
|
The `google_translate_say` service supports `language` and also `options` for setting `tld`. The text for speech is set with `message`. Since release 0.92, the service name can be defined in the configuration `service_name` option.
|
||||||
|
|
||||||
Say to all `media_player` device entities:
|
Say to all `media_player` device entities:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user