Delay is skipped

I have this automation:

- id: '1610906443953'
  alias: Snapshot Camera
  description: ''
  trigger:
  - platform: device
    type: turned_on
    device_id: 7c4bc9c45bf44f6dbfd1ab4a8dd96901
    entity_id: light.light_hallway
    domain: light
  condition: []
  action:
  - delay: 00:00:05
  - service: camera.snapshot
    data:
      filename: /config/foto/test.jpg
    entity_id: camera.camera_1
  - delay: 00:00:05
  - service: telegram_bot.send_photo
    data:
      file: /config/foto/test.jpg
  mode: single

Both delays are working correctly. When triggered, after 5 seconds a picture will be taken and after 5 more seconds the picture will be send.
When I put an extra action before the first delay, this delay will be skipped. The picture is taken immediately after triggering:


- id: '1610906443953'
  alias: Snapshot Camera
  description: ''
  trigger:
  - platform: device
    type: turned_on
    device_id: 7c4bc9c45bf44f6dbfd1ab4a8dd96901
    entity_id: light.light_hallway
    domain: light
  condition: []
  action:
  - service: light.turn_on
    data: {}
    entity_id: light.spot_1
  - delay: 00:00:05
  - service: camera.snapshot
    data:
      filename: /config/foto/test.jpg
    entity_id: camera.camera_1
  - delay: 00:00:05
  - service: telegram_bot.send_photo
    data:
      file: /config/foto/test.jpg
  mode: single

In this case a light is turned on but I can use any action, the delay will be skipped. I know in older versions a delay was skipped when the trigger triggered again while the delay was counting. That is not the case. I can put the actions into a script but I would like to understand why this isn’t working.

I don’t have an instance to check on right now but your automation looks correct to me.
It has mode: single
so any subsequent triggers, whist it is running, should be ignored.

This ‘should’ work as you intend it to.

Try extending the delays and putting an input number increment inbetween steps with a timestamp sent to a notification to debug or similar.

Edit:
It’s faily easy to set a ‘notification’ but other options are discussed here : -

your message may look something like this : -

{{ 'Event Index: ' ~ states('input_number.index') ~ ' - ' ~ now().strftime('%Y-%m-%d %H:%M:%S') }}

Thanks for your answer. Using the input number was a great idea (is used actually input datetime). The problem seems to be the camera. Besides the input-datetime I used a stopwatch in front of the camera so I could see the moment the picture was taken. Although HA triggers the camera at the right moment I get a photo from some seconds earlier. I suspect the camera of taking pictures every 10 (?) seconds and when you trigger the camera to take a picture you will get the last picture the camera made. So when I trigger at moment t I can get a picture from t-4s or t-5s or…
Maybe I have to configure the camera on a different way.