On the fly TTS

So when I finally decided to tackle text-to-speech I was surprised by how east it was to setup. I setup a few reminders for my daughter on school days and they worked great.

But often times my wife or I want to send my daughter a message after school. But her phone might be dead, or she just swipes away the notification, or she’s not in the room as one of the speakers.

I knew how to do it through developer tools. But I wanted a text input field and a button on the dashboard both me and my wife could use.

My initial tries just had it reading out the field names until I found the Config Template Card in HACS.

Text input card:

type: entities
entities:
  - entity: input_text.tts_google

Template button cards (one for each speaker):

type: custom:config-template-card
variables:
  Message: states['input_text.tts_google'].state
entities:
  - media_player.living_room_speaker
card:
  type: button
  show_name: true
  show_icon: true
  entity: media_player.living_room_speaker
  name: TTS Living Room
  tap_action:
    action: call-service
    service: tts.google_translate_say
    target: {}
    data:
      message: ${Message}
      entity_id: media_player.living_room_speaker
2 Likes