Home » Software » Home Assistant – Text to TTS

Home Assistant – Text to TTS

Set up helpers

Settings > Devices > Helpers > Create helper > Input text

Set up scripts

Setting > Automations > Scripts > Create script

There are a lot of possibilities here like turning off lights, playing a short announcement sound before the actual announcement. But the key is creating the TTS. This one is with piper:

action: tts.speak
data:
  cache: false
  media_player_entity_id: media_player.MEDIA_PLAYER_NAME
  message: "{{ states('input_text.NAME_OF_HELPER') }}"
  options:
    voice: en_US-danny-low
target:
  entity_id: tts.piper

Set up button in the Dashboard to execute the script.

type: horizontal-stack
cards:
  - type: entities
    entities:
      - entity: input_text.NAME_OF_HELPER
        name: Write your message here...
        icon: mdi:chat
    show_header_toggle: false
  - type: button
    icon: hass:send
    show_icon: true
    show_name: false
    styles:
      card:
        - height: 90px
        - width: 90px
    tap_action:
      action: call-service
      service: script.turn_on
      service_data:
        entity_id: script.NAME_OF_SCRIPT
grid_options:
  columns: full
  rows: 3
title: Voice Of God