🧯 TTS Script Blueprint for All 11 HA Core TTS Flavors

:mega: This is a script that can use any of the 11 integrated TTS Platforms in Home Assistant to send a message to a media player. Some will require Google Type Speakers, some will require Non-Google type speakers.

:bookmark_tabs: Changelog

  • 2022-05-05: Updated for 2022.5.0 HA. Changed Choose to if / then statement.
  • 2022-04-26: Add an optional action selector before and after the main TTS for volume, mp3 sounders, sirens, etc.
  • 2022-04-11: Add multiple to Speaker Selection and changed minimum HA to 2022.4.0
  • 2022-03-09: First blueprint version :tada:

:envelope_with_arrow: Get Started

Updates will be published on my GIT repository with the rest of my Home Assistant Blueprint collection.
The main problem I had with this blueprint is that I do not have all TTS platforms installed in my system, so there is no way I can test everything. I installed what I could and tested those. Others I just have made available the basic configuration of the tts*_say flavor, speaker entity, and message. If the integration page gave me more specific information, I went with that as options.


I am visioning this as a community project. The Github files are available for forking and PR’s. Also you can post suggestions in the community tab or on my Discord and we can make changes as changes need to be made. I cannot install and pay for all the versions of TTS out there, and I have not covered any of the custom integrations because I simply do not now what there is a demand for.
So if you have ideas and want to help test stuff or want to add some code, let’s have fun!


All constructive help is encouraged.


NOTE: This blueprint replaces 2 other blueprints, so those have been removed from the repository. All the functionality in those has been moved to this one.

  • tts_cloud_message_script.yaml

  • tts_google_translate_say_message_script.yaml


Option 1: My Home Assistant

Click the badge to import this Blueprint

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Please Click the :orange_heart: at the end of the Post if you find this Useful

Option 2: Direct Link

Copy this link if you want to import the blueprint in your installation.
https://github.com/SirGoodenough/HA_Blueprints/blob/master/Scripts/tts_All_Message_Script_Blueprint.yaml

:open_book: Description

These integrations are listed here. Please refer to these pages for care and feeding of the *tts_say method you choose.
:chains: Integrations - Home Assistant

This blueprint WILL NOT set-up TTS for you. You will be given the opportunity to add the incorrect options that will NOT allow your TTS to function. Your best road to success will be to add a TTS session with UI, and only after that is successfully talking to you should you take the languages and options that work there and apply them in this Blueprint. The safest thing to do other than that is to start with the basic sonfiguration for the TTS_say integration that you are using and add options one at a time after you have it working on a base level.

The very basic requirements are for you to provide the *tts_say method that you have installed and tested, the entity that you want to send it to, and the message you want to send. Beyond that likely involves trial and error that may best be done in the Developer Tools Services area here:

NOTICE: I have added an action statement both before and after the main TTS call. You can choose to ignore these, or you can use them to change volume, add a media player to play a doorbell, turn on a light, add a delay, whatever you want to do.

Open your Home Assistant instance and show your service developer tools.

:fire: This Blueprint makes the assumption that you already have a tested & proven TTS integration installed and you know how it works and how to use it. :fire:

You will need to verify that the name you have given to the TTS integration in your system configuration is the Default name or you need to change this blueprint to use the custom name you have set in the tts: section of configuration.yaml. :end:

:gear: Usage

:hammer_and_wrench: Installation

  • Open Home Assistant with administrator privileges and on a Lovelace screen, click anywhere in the main entity area and type the letter ‘c’. A selection box should pop up. Type blue and select the button to navigate to blueprints. You can also find blueprints by selecting configuration from the left menu and then blueprints from the center menu.
  • Once there, click on the ‘Import Blueprint’ button in the lower right side of the main screen.
  • In the ‘URL of the blueprint’ line type or paste in the URL of my Blueprint. I have the blueprint stored on my Public GitHub:

GitHub - SirGoodenough/HA_Blueprints: My Collection of Automation and Script Blueprints for Home Assistant

:dna: Home Assistant

Once installed, go into blueprints and use this to add a script with your variables. Answer the required questions and you can change or ignore the ones with defaults. Remember the name you typed in. For this example, we will suppose you named the script:
TTS Test One
After that, where ever you want this TTS to sound off in another script or an automation, you simply add a service: (See full examples in my configuration, link below.)

- service: script.tts_test_one

This makes your automation very clean looking and you move all the ‘noisy’ code elsewhere. It has greatly improved my ability to think out automations. This also keeps me from having to write the same code over and over for every TTS I want to send out. I have almost 30 different messages in my Home Assistant Configuration

:bulb: Fun Ideas

Random Response

This is a very simple sample test case, I wanted to see if it would work. To my delight I have been replacing all the TTS instances in my configuration with blueprints. It puts all the mess in one place. To call a specific message, I just fire the calling script and I have a 1 liner, done.

I have recently found that the !input will accept templates. Who knew, right? I have a few TTS instances that call for a random response, I just need the sound for timing of something I’m doing, and I found that something like this craziness works. It is the lyrics from a song and when triggered, it just picks one of them to play using random. It also picks a random language to speak the message from the list. Pretty slick, right?

Add MP3 File to TTS Call

Here is an example of playing a sound right before the TTS announcement of a doorbell. Below this picture (unseen) is all the TTS answers specific to your selected TTS and such. This picture is of the top part, the ‘Action before TTS’ sample, that you can set-up. In this example the sound file is stored on the media folder so it can be picked from the gui.

These action statements can also be used to change volume, flash a light, turn on a siren, anything you like.

:globe_with_meridians: All My Blueprints

Link to ALL my Blueprints

Here is a list of each of my blueprints, a quick description and jump links to the Blueprints Exchange post…

:cyclone: Scripts

:fire_extinguisher:Broadlink on Script Blueprint

This is a SCRIPT Blueprint that uses my Broadlink RM3 to turn my TV on and get it into the correct mode, Pushes remote buttons in sequence.

:fire_extinguisher:Tasmota EZ Button Blueprint

This Script Blueprint generates 3 Buttons to help you manage your Tasmota installed base. Restart All, Update a few, and Update all.

:fire_extinguisher:Play Media File Script Blueprint Blueprint

This is a SCRIPT Blueprint. This provides a way to play canned media files with the big long list of YAML entries but keep the main script or automation clean.

:fire_extinguisher:TTS All Message Blueprint

This script can use any of the 11 integrated TTS Platforms in Home Assistant to send a message to a media player.

:arrows_clockwise: Automations

:fire_extinguisher:Auto Fan Control Blueprint

This Blueprint is for controlling a 3 speed fan based on a temperature sensor. Both fan% control & MQTT fan control versions.

:fire_extinguisher:Door Open TTS Cloud-Say Message Blueprint

This Blueprint is a TTS.cloud-say version of another Door Announcer I found in the HA Blueprint Exchange.

:fire_extinguisher:Keypad Lock or puzzle Box Tool Blueprint

This Blueprint accepts 5 actions & when done in the right order, flips an input_boolean.

:fire_extinguisher:Zigbee2MQTT - Xiaomi Cube Controller Blueprint

This Blueprint uses a Zigbee2MQTT built sensor to sort out the multitude of commands from the Xiaomi Magic Cube Remote.

:fire_extinguisher:Zigbee2MQTT - ZemiSmart ZM-RM02 Controller Blueprint

This Blueprint uses the Z2M (Zigbee2MQTT) imported Action sensor to sort out the 18 commands from the ZemiSmart ZM-RM02 Controller.

:man_juggling:t5: Contact Links or see my other work

What are we Fixing Today Homepage / Website: https://www.WhatAreWeFixing.Today/

Channel Link URL: (WhatAreWeFixingToday) https://bit.ly/WhatAreWeFixingTodaysYT

What are we Fixing Today Facebook page (Sir GoodEnough): WhatAreWeFixingToday

What are we Fixing Today Twitter Account (Sir GoodEnough): https://bit.ly/WhatAreWeFixingTodayTW

Discord Guild: (Sir_Goodenough#9683) WhatAreWeFixingToday?

:cheese: If you want to support me

Buy me Coffee: Sir GoodEnough

PayPal one-off donation link: PayPal.Me

#WhatAreWeFixingToday

#SirGoodEnough

2 Likes

Perhaps add an option for volume control.

I’ll think about that.
It issue will be because dealing with all TTS means dealing with Alexa and Google and Sonos and Microsoft, I’m betting they don’t all handle it the same. I can only test the Google ones right now. No Alexa hardware. I don’t want to put out something on a guess if I don’t have to.

I was considering moving to the new media selector in the next HA version when they get it fixed. The first release had some problems.

Please click the heart in the top message if you found this useful…

I’m thinking something I could do short term is to add an action sensor that will just do nothing if people don’t need it, but could be used by the user to set-up a volume or flash a light or whatever you want to do. That would work.

Updated as per [MickW69’s suggestion by adding an action sensor before and after the TTS statement.
Use this for volume change or a siren or playing a media file or stacking all 3 in the same action sensor. OR just ignore them and don’t use them at all.

Existing blueprints will work without changes if you want to update to the new version.

Please Click the :orange_heart: at the end of the Top Post if you find this Useful

New Version today.
I did this a couple of days ago but released it today because of the problems with 2033.5.0 and 2022.5.1 releases not allowing Blueprint Imports.

  • 2022-05-05: Updated for 2022.5.0 HA. Changed Choose to if / then statement.

Updated the ‘other blueprints’ links.