Dim the lights after transition is complete

Hi, I wanted to dim my lights within a script after a light transition is complete (Or after 17 seconds). I recognized that “delay” stops the script and directly dims them. what would be a proper way to realize this?
Thanks
Kelvin

  - data:
      entity_id: light.mi_front
      hs_color:
      - 360
      - 100
      transition: 17
    service: light.turn_on
  - data:
      entity_id: light.mi_surround
      hs_color:
      - 360
      - 100
      transition: 17
    service: light.turn_on
  - delay: 00:00:17
  - data:
      entity_id: light.mi_front
      brightness: 1
    service: light.turn_on
  - data:
      entity_id: light.mi_surround
      brightness: 1
    service: light.turn_on

The delay step does not “stop” the script and directly dim the lights.

Is this a script, or the action part of an automation. If the latter, can you post the entire automation?

FWIW, if you’re turning on multiple lights with the same parameters you can do them all in one service call.

  - data:
      entity_id:
      - light.mi_front
      - light.mi_surround
      hs_color:
      - 360
      - 100
      transition: 17
    service: light.turn_on
  - delay: 00:00:17
  - data:
      entity_id:
      - light.mi_front
      - light.mi_surround
      brightness: 1
    service: light.turn_on

The delay step does not “stop” the script and directly dim the lights.

Thanks, I figured this out in the meanwhile. I think I come close to the problem now. What works is this script, in Isolation and also in the whole one:

1576066888300':
  alias: Transition
  sequence:
  - data:
      brightness_pct: 100
      entity_id: light.mi_front
      hs_color:
      - 360
      - 100
      transition: 10
    service: light.turn_on
  - data:
      brightness_pct: 10
      entity_id: light.mi_front
      hs_color:
      - 350
      - 100
      transition: 10
    service: light.turn_on

Increasing Brightness and all around the color wheel, then decreasing brightness and again all around the color wheel. This works because initial and end state are pretty similar.
But when e.g. the “daylight mode” was active before, first the bright white light ocures, then instantly drops in brightness and then the sequence starts. Or (just experienced due to yet unknown reasons) only the white light increases in brightness without any colors.
Maybe there is an option that the light “forgets” the last status or sth like this.
Here the whole script, everything else works fine.

'1575806592249':
  alias: Cinema Night
  sequence:
  - device_id: 377527aba2cf4f0789175543aa582510
    domain: light
    entity_id: light.backplug
    type: turn_on
  - device_id: 297c7b358b26401b9e635b77ae7f1a3f
    domain: light
    entity_id: light.frontplug_2
    type: turn_off
  - device_id: 297c7b358b26401b9e635b77ae7f1a3f
    domain: light
    entity_id: light.frontplug_2
    type: turn_on
  - device_id: c0cc0af0b3b84e11a100495497f095a1
    domain: light
    entity_id: light.leftlight
    type: turn_on
  - device_id: 2072dad3be264a89a3bb861a6d9047e9
    domain: light
    entity_id: light.sideplug
    type: turn_on
  - delay: 00:00:01
 - data:
      entity_id: light.mi_front
      hs_color:
      - 360
      - 100
      brightness_pct: 100
      transition: 10
    service: light.turn_on
  - data:
      entity_id: light.mi_surround
      hs_color:
      - 360
      - 100
      brightness_pct: 100
      transition: 10
    service: light.turn_on
  - alias: ''
    data:
      command: PowerOn
      device: 65245933
      entity_id: remote.harmonyhub
    service: remote.send_command
  - data:
      command: PowerOn
      device: 65261054
      entity_id: remote.harmonyhub
    service: remote.send_command
  - alias: ''
    data:
      entity_id: media_player.pionner_avr
      source: dvd
    service: media_player.select_source
  - data:
      entity_id: light.mi_front
      transition: 7
      brightness_pct: 1
    service: light.turn_on
  - data:
      entity_id: light.mi_surround
      transition: 7
      brightness_pct: 1
    service: light.turn_on

edit: Lights are connected in different ways. As normal Milights (as used here) but also via MQTT and as emulated Hues. MQTT should solve some issues, but hadnt the time yet to figure out how.