Chime TTS
Chime TTS is a custom integration for Home Assistant that combines audio files with Text-to-Speech (TTS) audio locally, creating seamless playback without any lag or timing issues caused by cloud TTS processing and networking delays - perfect for playing a notification sound with a TTS notification.
Installation
Refer to the GitHub wiki for further instructions.
Features
Chime TTS offers the following enhancements for TTS audio playback:-
No lag or timing issues: Cloud TTS processing and network delays are eliminated, ensuring precise timing between audio files.
-
Customizable audio cues: Play preset audio options or your own custom files before and/or after the TTS message, creating a single file with seamless playback.
-
Flexible TTS platform selection: Chime TTS supports TTS platform integrations in Home Assistant.
-
Easy service invocation: The Chime TTS ‘say’ service can be used in automations, scripts, and other Home Assistant components, and supports queuing multiple service calls.
-
Set media player notification volume: Set the volume of the media player for the notification, and restore it back once playback ends.
-
Configurable TTS playback speed: Set the desired playback speed of the TTS audio, anywhere from 100% - 200%.
-
Configurable delay: Set a custom delay period between audio files and TTS audio.
-
Caching: Audio created by Chime TTS can be cached for faster playback in future service calls.
-
Speaker Groups: Supported speakers can be grouped together for simultaneous playback.
Services
chime_tts.say
The chime_tts.say
service can play to multiple media_player
targets and supports the following parameters:
Name | YAML Key | Required? | Description | Default |
---|---|---|---|---|
Chime Path | chime_path |
Either an audio preset or a local audio file path to be played before the TTS message. | None | |
End Chime Path | end_chime_path |
Either an audio preset or a local audio file path to be played after the TTS message. | None | |
Delay | delay |
Delay (ms) between chime audio and the TTS message. | 450ms | |
Final Delay | final_delay |
Final delay (ms) added after playback (useful for queued calls). | 0ms | |
Message | message |
Required | The text to be converted into TTS audio. | None |
TTS Platform | tts_platform |
Required | TTS platform to be used to create TTS audio. Note: the TTS platforms must be installed separately. | None |
TTS Playback Speed | tts_playback_speed |
The desired playback speed for the TTS audio, anywhere from 100% - 200%. | 100 | |
Volume Level | volume_level |
The volume level (between 0.0 - 1.0) to play the audio. The original value will be restored after playback. | 1.0 | |
Join Players | join_players |
Play the audio simultaneously on media_players (that support speaker groups). | False | |
Cache | cache |
Save generated audio to the cache for reuse in future service calls. | False | |
Announce | announce |
Stops current media during the announcement and then resume (on supported devices). | False | |
Options | options |
YAML options field used by TTS services. | None |
Additional parameters (not supported by all TTS platforms)
Name | Parameter | Required? | Description | Supported TTS Platforms | Default |
---|---|---|---|---|---|
Language | language |
The speech language to use | Google Translate, Nabu Casa Cloud TTS | None | |
TLD | tld |
The dialect domain | Google Translate | None | |
Gender | gender |
Use a male or female voice | Nabu Casa Cloud TTS | None |
Example
service: chime_tts.say
data:
chime_path: custom_components/chime_tts/mp3s/tada.mp3
message: The washing's done!
tts_platform: google_translate
tts_playback_speed: 120
volume_level: 0.7
cache: true
announce: true
language: en
tld: com.au
target:
entity_id:
- media_player.homepod_mini
- media_player.kitchen
chime_tts.say_url
The chime_tts.say_url
service returns a publicly accessible URL to the MP3 file generated by chime_tts.say
. Use cases may include playing the audio on media_players from Alexa, for example, which require a publicly available MP3 URL.
The service accepts the same parameters as chime_tts.say
, except the media_player
target and other media_player-related attributes.
Name | YAML Key | Required? | Description | Default |
---|---|---|---|---|
Chime Path | chime_path |
Either an audio preset or a local audio file path to be played before the TTS message. | None | |
End Chime Path | end_chime_path |
Either an audio preset or a local audio file path to be played after the TTS message. | None | |
Delay | delay |
Delay (ms) between chime audio and the TTS message. | 450ms | |
Final Delay | final_delay |
Final delay (ms) added after playback (useful for queued calls). | 0ms | |
Message | message |
Required | The text to be converted into TTS audio. | None |
TTS Platform | tts_platform |
Required | TTS platform to be used to create TTS audio. Note: the TTS platforms must be installed separately. | None |
TTS Playback Speed | tts_playback_speed |
The desired playback speed for the TTS audio, anywhere from 100% - 200%. | 100 | |
Options | options |
YAML options field used by TTS services. | None |
Additional parameters (not supported by all TTS platforms)
Name | Parameter | Required? | Description | Supported TTS Platforms | Default |
---|---|---|---|---|---|
Language | language |
The speech language to use | Google Translate, Nabu Casa Cloud TTS | None | |
TLD | tld |
The dialect domain | Google Translate | None | |
Gender | gender |
Use a male or female voice | Nabu Casa Cloud TTS | None |
Example
The following YAML generates an MP3 file and then plays it on Alexa speakers as a publicly accessible MP3 URL:
sequence:
- service: chime_tts.say_url
data:
chime_path: mp3_path_placeholder-bells_2
tts_platform: google_translate
message: This is a Chime TTS test on Alexa speakers
language: en
response_variable: chime_tts
- service: notify.alexa_media
data:
message: |
<audio src='{{chime_tts.url}}'/>
target:
- media_player.echo_show
- media_player.echo_plus
- media_player.bathroom_echo
- media_player.bedroom_echo
data:
type: tts
chime_tts.clear_cache
The chime_tts.clear_cache
service removes all generated audio cache files & references to cached TTS audio.
service: chime_tts.clear_cache