TTS Transport Adaptor¶
| Transport ID | Source | Requirements | Optional |
|---|---|---|---|
tts | tts.py | TTS Integration | - |
Announce, or speak, a notification using one of Home Assistant's built-in Text-to-Speech integrations. By default, it uses the tts.home_assistant_cloud by Nabu Casa, thougn any supported tts can be used. It also supports the Android Companion App TTS
Text-to-Speech Integration¶
This integration automatically sets the action to tts.speak and limits the data section to the supported values, such as cache, language and options.
The action can be overridden if desired to the older tts.say
The message_usage option can be set to combine_title or use_title to override the default behaviour of speaking the standard.
Choosing the TTS Provider¶
Changing the Action¶
delivery:
speak_it_out:
transport: tts
action: tts.speak_cloud
options:
- tts_entity_id: tts.google_ai_tts
Under the Hood¶
The Home Assistant TTS Integration calls the tts_entity_id to generate an audio file from the text, and then uses the media_player virtual integration to play this audio file. The Entity Platform (see Entity Architecture) creates jobs per entity for this - not per platform, so there can be a delay between each device making its announcement. It does however try to preserve the order in which the media_player entities were listed.
Android Companion App¶
If a mobile_app_XXXX target is passed to this transport, it will check if its an Android ( or more precisely not an Apple) mobile app, and generate an action call like:
action: notify.mobile_app_my_pixel
data:
message: "TTS"
data:
tts_text: "This is the notification message"
The targets can be skipped if device discovery is switched on in the delivery configuration, in which case every notification will be announced on every Android companion app unless overridden. This example uses the delivery_defaults at the Transport level, which changes the defaults for all Deliveries. The tts adaptor always filters out Apple devices, and further filtering can be made in the options for model, manufacturer, label and area (see Table of Options for the list of options and the include/exclude syntax).
Media Player and Android targets can be combined in one call - the tts transport will work out which calls to make.
Alternatives¶
For Amazon Echo devices, text-to-speech is also available via the Alexa Devices and Alexa Media Player transport adaptors.
To get canned sounds rather than speech, use the Chime transport adaptor.