Can't run script in parallel

Good evening,
I wrote these two scripts, one call the other 3 times and even if they are set in parallel mode, actually they wait for the previous script delay to end before starting. Any clue ?

thank you

close_half_roller_shutter:
  alias: close_half_roller_shutter
  mode: "parallel"
  fields:
      device_id:
        description: "the device id"
        example: "newkaku_XXXX"
  sequence:
  - service: rflink.send_command
    data_template:
      command: "off"
      device_id: "{{device_id}}"
  - delay: "{{ states('variable.roller_shutter_timer_' + device_id) | int }}"
  - service: rflink.send_command
    data_template:
      command: "off"
      device_id: "{{device_id}}"

and

close_all_half_roller_shutter:
  alias: close_all_half_roller_shutter
  mode: "single"
  sequence:
  - service: script.close_half_roller_shutter
    data:
      device_id: "newkaku_XXXX"
  - service: script.close_half_roller_shutter
    data:
      device_id: "newkaku_YYYY"
  - service: script.close_half_roller_shutter
    data:
      device_id: "newkaku_ZZZZ"

Instead of calling the script as a service you need to use the script.turn_on service if you want the script to run in parallel with the calling actions. See https://www.home-assistant.io/integrations/script/#waiting-for-script-to-complete

Setting the script mode to parallel just allows more than one instance of the script to run at at the same time.

Hi @tom_l, such simple, thank you very much!

1 Like