Amazon Polly linked with echo dot Help please

Hi, just wondering if anyone can give me some advice and weather this can be done. I have sensors all in my home, and one on the front door, my idea is to use amazon polly linked to an echo dot, for it to announce somthing when the door is opened, for example “welcome home”
I understand how to intergrate amazon polly to a speaker but how would I trigger it with a sensor?

Thanks in advance

This is my automation to announce that the front door has been left open so something similar should work:

- alias: 'Front Door Left Open'
  initial_state: True
  trigger:
    - platform: state
      entity_id: 
        - binary_sensor.alarm_front_door
      to: 'on'
      from: 'off'
      for: '00:05:00'
  action:
   - service: tts.amazon_polly_say
     data_template:
       entity_id: 
           #media_player.hall_speaker
           group.door_bell
       message: >
         Attention. The front door has been left open for the last five minutes

Thank you very much, that will help me loads! Perfect example just needs changing abit! :+1:

hi @daveyrb I have set my echo dot up to home assistant as a media player… I can see the entity in home assistant and it works perfectly for playing music. so I know home assistant and the dot is connected… my problem is that I cant get the text to speech to work. I have added my amazon polly details and I can see that service, but when I create a script using amazon polly sent to my echo dot it doesn’t seem to work… can you please help me out?
thanks

@daveyrb what speaker are you using for the text to speech ? thanks

Anyone give me some advice please?
Thanks

I am using a Google Chrome Audio and also an Install of Kodi to send TTS to. These both work fine I don’t have any echo devices so cant really help sorry.

Cool, I had never heard of Amazon Polly. and I was just looking for a TTS program to make sound files from text. I do use Amazon TTS (TTS on Alexa?) to make announcements around the house.

Was Polly difficult to get set up, and what happens after your free year?

I see this is a very old topic, but I am playing with this stuff now. both google and polly tts service creates mp3 files in your /config/tts directory. Amazon doesn’t allow mp3 files to be played on echo devices. I purchased a sonos SYMFONISK to play with polly, and it is working great. to get tts announcements on echo devices you have to use the notify service like this…

service: notify.alexa_media_all_echos
data:
  message: The inside front door has been opened
  data:
    type: announce