/Making-TTS-Better

Give your Alexa (or Google Home) more personality with generated sentences.

Making-TTS-Better

Give your Alexa (or Google Home) more personality with generated sentences.

speak_bedroom_temperature:

  alias: Speak Bedroom Temperature
  sequence:
    - service: notify.alexa_media
      data_template:
        target: 
          "{{ states.sensor.last_alexa.state }}"
        data:
          type: tts
        message: "Current Temperature,
        {{states('sensor.bedroom_temperature')}},
        Thermostat set to,
        {{state_attr('climate.bedroom_cooling', 'temperature')}},
        and the Thermostat is,
        {{ states.input_boolean.heating_auto.state }}"

speak_heating_auto_off:

  alias: Heating Auto Off
  sequence:
    - service: notify.alexa_media
      data_template:
        target:
          - "{{ states.sensor.last_alexa.state }}"
        data:
          type: tts
        message: '{{
          [
          "Bedroom temperature set to manual",
          "Bedroom temperature to manual control",
          "I will no longer control the bedroom temperature",
          "Temperature of the bedroom set to Manual",
          "Control of the bedroom climate is yours",
          "I have stopped controlling the bedroom temperature"
          ]|random}}'

speak_window_lights:

alias: Speak Window Lights
sequence:
  - service: notify.alexa_media
    data_template:
      target:
        - "{{ states.sensor.last_alexa.state }}"
      data:
        type: tts
      message: '{{
        [
        "Turning on window lights... ",
        "Window lights on... ", "Window lights coming on... ",
        "Lighting up the window... ",
        "Your Window lights are on... ",
        ]|random +[

        "Hmmm, ",
        "Arr, ",
        "Wow, ",
        "Cool, ",
        "sweet, ",
        ]|random +[

        "Blue.",
        "Thats Pretty.",
        "How Nice.",
        "Oh I do love Blue.", "I so love Blue.",
        ]|random}}'

How to make the "Last Alexa" Make a new 'sensor' .yaml file with this code:

- platform: template
  sensors:
    last_alexa:
      entity_id:
        - media_player.desk_dot  # Add your Devices here
        - media_player.bedroom_dot
        - media_player.this_device
      value_template: >
        {{ states.media_player | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}

BMC