WLED Segments Automation (Is there a better way to do it)

Hi There,

im currently planning do to some kind of Stair Lightning.
Where every stair is its on LED Segment in WLED. So when a Motion Sensor triggers at the Top every Stair gets Lit up with a little Delay. The Problem i’ve is that there are like 12 Segments so the Automation gets verry big.

Is there a better Way todo? :slight_smile:

alias: LED Turn On
description: ""
trigger:
  - platform: time_pattern
    seconds: "1"
condition: []
action:
  - service: light.turn_on
    target:
      entity_id: light.wled
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_1
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_2
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_3
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    target:
      entity_id: light.wled_segment_4
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_5
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_6
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_7
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    target:
      entity_id: light.wled_segment_8
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_9
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_10
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_11
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    target:
      entity_id: light.wled_segment_12
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.wled_segment_13
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 300
mode: single

Hi @maginator

It may be worth taking a look at the Counted Repeat section in here