Running multiple scripts even if not finished but delayed

Hello,
I have some RGB bulb and I’d like to create some sliding effects through them.
I’ve created a script with a simple color loop (I’ve tried using some blueprints too), where the bulb change its color (for example red->blue->cyan->repeat) untill it’s turned off.
Since I’ve multiple bulb I’d like to start this script in every bulb but delayed every time on each bulb (to create a sliding effect).
script on bulb 1 → wait 1s → script on bulb 2 etc…
The problem is that a regular automation like:

  - service: script.color_loop_bulb_1
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: script.color_loop_bulb_2
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: script.color_loop_bulb_3
    data: {}

will wait each time for the end of the previous script to start the second one.
If I use the “parallel” option the script will start on every bulb ignoring the delay.

Can someone help me please?

Thank you

Try changing this to:

- service: script.turn_on
  target: 
    entity_id: script.color_loop_bulb_1

If you call the script directly like you are then the automation will wait for the script to complete, however if you call the script turn_on the the script is started and the automation will continue without waiting for the script to finish.

thank you very much it’s exactly what I was looking for!

1 Like