How to send announcement using Test-to-Speach service?

Hello,

I am trying to send announcement to my media player. I do not need to script it or schedule. This is one time deal. It could happen a few times per year.
This is my configuration file:

tts:
  - platform: google_translate
    service_name: google_say

I am trying to send it using Template section under Developer Tools. Can someone tell me what am I doing wrong here? I am trying to use the following script, but I tried different variations and nothing works.

{%
{
  service: "tts.google_say"
  entity_id:  "media_player.living_room_google_home"
  data:
    message: "May the Force be with you."
  }
%}

Whatever I try, I got the following error:

Error rendering template: TemplateSyntaxError: tag name expected

I think you’re problem is that you have extra templating characters outside of your json. Try removing the {% at the beginning and %} at the end - they shouldn’t need to be there

Also, I’m not immediately familiar with the templates you are using, but your syntax is a mixture of json and yaml… I’m guessing it’s supposed to be json, though? Your dictionary keys need quotes around them, and data’s value should have curly brackets around the message portion. Sorry, typing from phone or else I’d just type it out exactly…

I want my media player to say the phrase.
This what I see when I try to use it with Template:

Also, I tried to call the service and I have this:

for the service call try this:

entity_id: media_player.living_room_google
message: 'Hi - a test'

you don’t need data: in this GUI as it is already there (hidden/wrapped in the way the service call is done)

Thank you for suggestion. The first time I tried it, my media player made some “bleep” sound and nothing else. After that, when I try it, there is no sound even after I restart HA.

You may need to configure the base_url option.

a beep means the HA was able to access the device. The lack of message is likely as per 123 above.

# Text to speech
tts:
  - platform: google_translate
    service_name: google_say
    base_url: https://mydomain.hopto.org

(your entry will of course be different)