Alexa Announce not working

Hi,

I seem to have a problem with Alexa making announcements in my configuration.

I have the integration installed via HACS, i can see all the device states and the media player entities for all my Echo devices and when i run the check config all comes back as good.

Below are code snippedts from the scripts and automation yaml files

# Andrew is home notification
- alias: 'Andrews Home notification'
  initial_state: true
  trigger:
    platform: state
    entity_id: person.andrew
    from: 'not_home'
    to: 'home'
    for:
      seconds: 90
  condition:
    - condition: template # only notify once every 10 minutes at most
      value_template: "{{ ( as_timestamp(now()) - as_timestamp(state_attr('automation.andrews_home_notification', 'last_triggered')) |int(0) ) > 3600 }}"      
  action:
    - service: notify.all
      data:
        title: "Home Assistant"
        data:
          type: announce 
        message: 'Welcome Home Andrew' 
    - service: script.audio_notify
      data_template:
        tts_msg: "Welcome Home Andrew"    

scripts.yaml

  ## Send Speech to Alexa
  audio_notify:
    sequence: 
      - service: notify.alexa_media
        data:
          target:
            - media_player.master_bedroom
            - media_player.kitchen            
            - media_player.dressing_room 
            - media_player.charlotte_s_bedroom            
            - media_player.office
            - media_player.katie_s_bedroom            
            - media_player.hot_tub
          data:
            type: announce
            #method: all
          message: "{{ tts_msg }}"

I know the automation is working as i expect as i get the notification on my phone and other devices its just the TTS never happens.

Also below is a screenshot showing one of the listed devices states which to my eye appear to be all good.

I have also gone into the alexa app on my phone and checked that communication is enabled on all the devices which it is.

I am lost now.

Any help would be appreciated

Think you need to use data_template as you have a template in your message, this is an extract from one of mine:


    - service: notify.alexa_media
      data_template:
        target:
          - media_player.living_room
          - media_player.office
          - media_player.kitchen
        data:
          type: announce
        message: "The {{ trigger.to_state.object_id }} door has been left open"
3 Likes

data_template solved the problem thanks

Could you Mark the post as solved ?