Announce text-to-speech on media player

This blueprint allows you to create an announce script for your dashboard that is pre-configured to a specific media player and text-to-speech engine.

It is meant to be added to your dashboard. When activated, it will ask the user for the message to play.

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

This blueprint requires Home Assistant 2024.3 or later.

blueprint:
  name: Announce
  description: >-
    A script that announces a message on a media player using text-to-speech.
  domain: script
  input:
    text_to_speech_engine:
      selector:
        entity:
          domain: tts
      name: Text-to-Speech engine
    media_player:
      selector:
        entity:
          domain: media_player
          multiple: true
      name: Media Player

mode: queued

fields:
  message:
    selector:
      text:
        multiline: true
    name: Message
    description: The message to broadcast
    required: true

sequence:
- service: tts.speak
  data:
    media_player_entity_id: !input media_player
    message: "{{ message }}"
  target:
    entity_id: !input text_to_speech_engine
3 Likes

Thanks a bunch for the blueprint. Works great on the homepods but fails on the Amazon echos with the " having trouble accessing the simon says skill etc" since Alexa Media Player can’t use the same TTS service. That was after adding the external URL to Alexa media player - prior to that it errored out with Alexa telling me to add the external URL to Alexa Media Player. I am not the best with blueprints and thought to change things to work with the echo speakers but I hit a road block before the workday started and now its on the back burner.

Do we just need to use a different TTS engine?

Love this blueprint and having it from my dashboard, very cool! One suggestion I’d give is to send a volume as well. That may significantly complicate things (e.g. get current volume, set volume to the user-selected variable, send tts, reset volume to original) but could be a good QoL feature. I set this blueprint up for 8 of my sonos speakers around the house, and I know from some of my other automations that TTS can come through a lot quieter than I’d like if I’m trying to actually get someone’s attention. We usually listen to music at 10-20% volume, but TTS works best (i.e. isn’t too loud or too quiet) at something like 60%

Thanks for this blueprint.
What would be the best way to add an option to select which media player to cast the announce to inside the script?
So not have one script for each media player but just one script with the option to select where to cast to?
I tried it with a selfmade list but that just doesn’t look nice and fails when selecting more than one entry.
I tried it with entity but that gives me a huge list of all entities.
Add a media selector expects me to select media and not just the media player.

Any nice solutions here?

I did this a couple of years ago.

🧯 TTS Script Blueprint for All 11 HA Core TTS Flavors.

HA_Blueprints/Scripts/tts_All_Message_Script_Blueprint.yaml at c05d6fb431c1d84cb145c7d6dd5ffe5a60b1d9e2 · SirGoodenough/HA_Blueprints · GitHub.

It includes roll-your-own action sections for before and after so you can adjust volume, play a sound effect, notify your phone, or any other action.

Pardon my ignorance, but how do I add this to my dashboard?

Thanks! I’ve wondered about this type of thing before (kitchen to office notes, etc.

So far the kids and I have had fun with it.