Several Alexa devices, repeating chime x times

Dear community,

I’m trying to create an automation whereby 2 Alexa devices (one in the living room, the other in the kitchen) need to repeat the chime 5 times whenever the doorbell has been pressed. I do not have any programming skills, but this is what I created with the built-in Actions within “Automation & Scenes” menu in Home Assistant:

'repeat:
count: “5”
sequence:

service: media_player.play_media
target:
entity_id: media_player.living
data:
media_content_id: amzn_sfx_doorbell_chime_01
media_content_type: sound
metadata: {}
service: media_player.play_media
target:
entity_id: media_player.kitchen
data:
media_content_id: amzn_sfx_doorbell_chime_01
media_content_type: sound
metadata: {}’

Problem:
I want to make use of the 2 Alexa devices, and not any other devices that I possibly have to purchase.

Solution:
I want that the two Alexa devices ring simultaneously x times so that we can check who is at our door.

Describe alternatives you’ve considered
It should of course not be possible to do this with only two devices, but with more Alexa devices in the future.

Context:

Thanks

Please format your code block so we tell if that is the source of the problem.

One glaring issue is that you have not provided a delay. Without a delay, the service calls will be made immediately one after the other. That means one of more of the calls will reach Amazon’s servers while the sound is already playing, which can cause the request to be dropped on their side. Your delay should be about as long as the play length of the sound, and having it a little longer is better.

FWIW, the best you’re likely to get is kind-of-simultaneous… playing sounds doesn’t seem to work on Alexa speaker groups, so you have to call the service on multiple targets, but they rarely play at the exact same time…

- repeat:
    count: 5
    sequence:
      - service: media_player.play_media
        data:
          media_content_id: amzn_sfx_doorbell_chime_01
          media_content_type: sound
        target:
          entity_id: 
            - media_player.living
            - media_player.kitchen
      - delay: 2

Since this hoes through Alexa (Amazon) cloud, I’m not sure the simultaneous part of your question can be achieved. That is to say, with a similar “need for automation”, I gave up on it.

@Didgeridrew Thanks for helping me out here. It worked like a charm!