Alexa tts volume

Yeah, sorry for my missleading post.
I have another script “Announce All” which checks various things (is light on in this room…) and run the single script multiple times. Here it is:

alias: Notify Devices (Alexas, TV, Mobiles, ...)
sequence:
  - service: notify.all_devices
    data:
      message: "{{ speaktext }} {{ now().strftime('%H:%M:%S') }}"
      data:
        ttl: 0
        priority: high
  - choose:
      - conditions:
          - condition: state
            entity_id: media_player.fernseher
            state: "on"
        sequence:
          - service: notify.android_tv_wohnzimmer
            data:
              title: "{{ tvtext }}"
              message: ""
              data:
                duration: 10
                position: bottom-right
                fontsize: large
                transparency: 0%
                color: grey
                interrupt: 0
                icon:
                  url: "{{ tvicon }}"
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: media_player.fernseher_2
            state: "on"
        sequence:
          - service: notify.android_tv_schlafzimmer
            data:
              title: "{{ tvtext }}"
              message: ""
              data:
                duration: 10
                position: bottom-right
                fontsize: large
                transparency: 0%
                color: grey
                interrupt: 0
                icon:
                  url: "{{ tvicon }}"
    default: []
  - service: script.turn_on
    target:
      entity_id: script.alexa_announce
    data:
      variables:
        alexa_device: media_player.wohnzimmer
        alexa_service: notify.alexa_media_wohnzimmer
        alexa_volume_speak: "{{ speakvolume }}"
        alexa_message: "{{ speaktext }}"
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 500
  - service: script.turn_on
    target:
      entity_id: script.alexa_announce
    data:
      variables:
        alexa_device: media_player.kuche
        alexa_service: notify.alexa_media_kuche
        alexa_volume_speak: "{{ speakvolume }}"
        alexa_message: "{{ speaktext }}"
  - choose:
      - conditions:
          - condition: device
            type: is_on
            device_id: c8748498bc7901901dc9f210e142b163
            entity_id: light.bad_decke
            domain: light
        sequence:
          - delay:
              hours: 0
              minutes: 0
              seconds: 0
              milliseconds: 500
          - service: script.turn_on
            target:
              entity_id: script.alexa_announce
            data:
              variables:
                alexa_device: media_player.badezimmer
                alexa_service: notify.alexa_media_badezimmer
                alexa_volume_speak: "{{ speakvolume }}"
                alexa_message: "{{ speaktext }}"
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.presence_arbeitszimmer
            state: "on"
        sequence:
          - delay:
              hours: 0
              minutes: 0
              seconds: 0
              milliseconds: 500
          - service: script.turn_on
            target:
              entity_id: script.alexa_announce
            data:
              variables:
                alexa_device: media_player.buro
                alexa_service: notify.alexa_media_buro
                alexa_volume_speak: "{{ speakvolume }}"
                alexa_message: "{{ speaktext }}"
    default: []
  - choose:
      - conditions:
          - condition: state
            entity_id: binary_sensor.bed_occupied
            state: "off"
        sequence:
          - delay:
              hours: 0
              minutes: 0
              seconds: 0
              milliseconds: 500
          - service: script.turn_on
            target:
              entity_id: script.alexa_announce
            data:
              variables:
                alexa_device: media_player.stefi_s_echo_show
                alexa_service: notify.alexa_media_stefi_s_echo_show
                alexa_volume_speak: "{{ speakvolume }}"
                alexa_message: "{{ speaktext }}"
          - service: script.turn_on
            target:
              entity_id: script.alexa_announce
            data:
              variables:
                alexa_device: media_player.tobias_echo_show
                alexa_service: notify.alexa_media_tobias_echo_show
                alexa_volume_speak: "{{ speakvolume }}"
                alexa_message: "{{ speaktext }}"
    default: []
mode: parallel
max: 20

This is called from an automation like this:

service: script.turn_on
target:
  entity_id: script.notify_devices
data:
  variables:
    speakvolume: 0.35
    speaktext: Trockner ist fertig, bitte ausräumen!
    tvtext: Trockner ist fertig, bitte ausräumen!
    tvicon: http://192.168.0.8:8123/local/trockner.png

Hope this helps.

pOpY

1 Like