Script sequences - confusing a noob

Not sure what I’m doing wrong here, but as a simple test, I want to a) play a chime over Google Home, and then b) do a TTS announcement to ask one of my kids to come down for dinner. I’ve created this via the GUI but for some reason I can’t get it to run the chime. Most of the time it just does the TTS. Sometimes it randomly plays the chime only. Are both of these getting triggered at once? Do I need a pause or something to fire them in sequence?

comedownstairs:
  alias: Buddy, Come Downstairs
  sequence:
  - data:
      media_content_id: https://<domain>.duckdns.org:8123/local/Computer_Magic.mp3
      media_content_type: music
    entity_id: media_player.library_speaker
    service: media_player.play_media
  - data:
      entity_id: media_player.library_speaker
      message: Buddy, come downstairs
    entity_id: media_player.library_speaker
    service: tts.google_say

I’m no expert in the flow of HA but I think not exactly.

They are both being triggered in sequence as you expect but the TTS will start as soon as the chime service has fniished being called. It won’t wait for the chime to actually play.

This means the TTS will start, so overriding the chime.

You need a delay between the two. It’s all a bit clunky but in this specific case you know exactly how long the chime is so it is easy.

1 Like

Hi, you are using the same entity, so the two action will overlap.
Try a delay between the chime and the TTS

1 Like

Thanks guys! 5 second delay seems to do the trick.