Simple TTS script

I am wanting a simple Text-To-Speech script that I can link to a button that simply broadcasts “Please call me” to a speaker.

Using the Script wizard, I have created the following:

service: tts.speak
metadata: {}
data:
  cache: true
  media_player_entity_id: media_player.photo_display
  message: Please call me.

When I try run it, I get “Failed to call service script/broadcast_please_call_me. must contain at least one of entity_id, device_id, area_id, floor_id, label_id.”

In the Wizard, non of the targer options appear to have anything linked to them so I can’t add them. This said the “Media player entity” specifies a target so I thought that would not be a problem.

I am guessing that I need to add the target explicitly but as no options appear in the wizard when I try, I am not sure how to.

That means you don’t have any TTS integration installed.

Either install one or use the tts.google_translate_say service call.

But that is what confuses me because I do. I am using a telegram bot integration that calls the TTS service. And this works.

alias: "Telegram: /say"
description: Broadcast message to speakers
use_blueprint:
  path: marc-romu/telegram-bot--command__action.yaml
  input:
    telegram_command: /say
    telegram_bot: "@baselmania_bot"
    sequence:
      - service: scene.create
        data:
          scene_id: photoframe_savesettings
          snapshot_entities:
            - media_player.photo_display
        enabled: true
      - service: media_player.volume_set
        data:
          volume_level: 1
        target:
          device_id: cxxxxxxxxxxxxxxxxxxx2
      - service: tts.google_translate_say
        data:
          entity_id: media_player.photo_display
          message: "{{ telegram_args_as_text }} "
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
          milliseconds: 0
      - service: scene.turn_on
        data: {}
        target:
          entity_id: scene.photoframe_savesettings
        enabled: true

Just realised that the telegram bot uses gogle translate and I was using google say.

Think that I am sorted now.