A question about delay and transition

Hi.
In automations and script it is possible to set a delay between actions.
In the light service it is also possible to use transition to specify how many sec the transition from state to state should take.
In this script both are used: Wake up sunrise simulation with the Philips HUE and Sleep as Android

This should turn brightnes to 100 in 1 minute:

- service: light.turn_on
      data:
        entity_id: light.lamp
        brightness: 100
        transition: 60

Then what will this next one do?
Will it A: Dim both lamp and lamp_2 to 100 in 1 minute
Or will it B: Dim lamp to 100 within one 1 min, and then dim lamp_2 to 100 the next minute?

- service: light.turn_on
      data:
        entity_id: light.lamp
        brightness: 100
        transition: 60
- service: light.turn_on
      data:
        entity_id: light.lamp_2
        brightness: 100
        transition: 60

And what about delays? Will this below first set the lamp brightness to 50, and after 1 min, set it to 75, and after another min set it to 100?

- service: light.turn_on
  data:
    entity_id: light.lamp
    brightness: 50
- delay: '60'
- service: light.turn_on
  data:
    entity_id: light.lamp
    brightness: 75
- delay: '60'
- service: light.turn_on
  data:
    entity_id: light.lamp
    brightness: 100

And one last question:
is these the same?

- delay: '60'

- delay:
  seconds: 600
1 Like

Then what will this next one do?

Actions in an automation/script happen simultaneously unless a delay is used. That example would turn both lights on to 100% brightness over 60 seconds simultaneously. The spacing is off in that example though.

And what about delays?

If you have a delay between automation/script actions, it will carry out all actions before the delay (again, simultaneously), wait the length of the delay, then continue to the other actions.

is these the same?

No. delay: '60' is not a valid format for delay (at least not per the documentation). It should be:

delay:
  seconds: 60

or

delay: '00:01:00'

…which is one minute. Format is HH:MM:SS.

Yes, it actually is valid. It might not be documented, but it works. A simple number is interpreted as seconds. Although I do agree that

delay:
  seconds: 60

is easier to understand.

Ugh I thought I might have seen someone use that… looks like I’ll add it to the docs.

If you use the automation gui editor and add a delay with just a value it will make delay: '60' in YAML