Alexa announce with Template - Syntax?

Hello guys,

I am still struggling with syntax for templates.

This works without templates:

- alias: Notification Test Weekly TTS
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: input_boolean.test
      to: 'on'
  action:
    - service: notify.alexa_media
      data:
        target: 
          - media_player.echo_wohnen
        data:
          type: announce
        message: "Dies ist ein Test."

This doesnt.

- alias: "Announce open windows when door is open"
  trigger:
  - platform: state
    entity_id: binary_sensor.hausture
    from: 'off'
    to: 'on'
  # condition:
  action:
    - service: notify.alexa_media
      data_template:
        target: 
        - media_player.echo_wohnen
        data:
          type: annouce
        message: >-
          {% set windows = [states.sensor.window_arbeiten, states.sensor.window_wohnen, states.sensor.window_essen, states.sensor.window_kueche, states.sensor.window_gwc, states.sensor.window_bad, states.sensor.window_franka, states.sensor.window_annika, states.sensor.window_eltern, states.sensor.window_hwr] %}
          {% set windows_open = windows | selectattr('state','ne','zu') | list %}
          {% set windows_name = windows | selectattr('state','ne','zu') | map(attribute='name') | join(', ') %}
          
          {% if (windows_open|length==1) %}
            "Es ist noch ein Fenster offen. {{ windows_name }}."
          {% elif (windows_open|length>1) %}
            "Es sind noch Fenster offen. {{ windows_name|regex_replace(',([^,]*)$',' und\\1') }}."
          {% elif (windows_open|length==0) %}
            "Alle Fenster sind zu."
          {% else %}
            "Mir ist unklar ob noch Fenster offen sind."
          {% endif %}

I tried without the " as well with same result. No announcements. Needless to say that I tried the script part in the UI and there it worked. Log file is not conclusive as well.

Thanks.

Regards
Ralf

data_template:
  target:
  __- media_player.echo_wohnen

Sometimes its worth just making a break and rethink … . Two missing spaces was the problem.