This code works fine:
sunrise:
alias: Sunrise
mode: single
sequence:
- repeat:
sequence:
- data:
brightness_step: 2
entity_id: light.sonoff
service: light.turn_on
- delay:
seconds: 1
until:
- condition: template
value_template: '{{ repeat.index >= 124 or states.light.sonoff.state
== ''off''}}'
And this one stops after one pass:
sunrise:
alias: Sunrise
mode: single
sequence:
- repeat:
sequence:
- data:
brightness_step: 1
entity_id: light.sonoff
service: light.turn_on
- delay:
seconds: 1
until:
- condition: template
value_template: '{{ repeat.index >= 124 or states.light.sonoff.state
== ''off''}}'