Automation action and script execution

Hi,

Question about the way HASS executes automation action with scripts.

If I trigger the demo script below it will turn on the scene and than run a script.

  1. Does the script start after the scene code is finished?
  2. Or do they start at the same time

After the script notification 1 is sent.
3. Will the notification will be sent after the script finishes execution?
4. Or do they start at the same time

After the script notification 2 is sent.
5. Will the notification will be sent after first notification is sent?
6. Or do they send at the same time

automation:
    - alias: Demo
      trigger:
        - platform: state
          entity_id: switch.demo_switch
          to: 'on'
      action:
        - service: scene.turn_on
          entity_id: scene.demo_scene
        
        - service: script.do_some_audio_stuff

        - service: notify.notify_demo_1
          data:
            message: Demo message 1

        - service: notify.notify_demo_2
          data:
            message: Demo message 2

script:
  do_some_audio_stuff:
    alias: Do Some Audio Stuff
    sequence:
      - service: media_player.turn_on
        entity_id: media_player.tv
      
      - delay: '00:02:00'
      
      - service: media_player.play_media
        entity_id: media_player.chromecast
        media_content_id: "some_content"

No, the get fired in order but do not wait for the action to fully complete, you can turn on info in the logger component and watch the services get called if you need verification.

If you want things to wait, you can use wait templates to slow up the actions.