Multiple simultaneous triggers

If an automation (in parallel run mode) has 3 time based (on 3 independent input_datetime helpers) triggers that happen to fire simultaneously, does the automation run:-

  • 3 times, each with the appropriate trigger set?
  • once with all triggers set?

If the former then effectively 3 independent automations are run, each processing a trigger and the specified action.

If the latter and for each trigger-id there’s a conditional check (for other factors) that stops the automation if not met, then it would seem that only the first action would ever be taken, or does it somehow run the action for each trigger anyway?

If triggers fire at different times, then I think it’s clear what happens, but not so much if they all fire at the same time and trying to clarify that in my mind.

This is trivially easy to test - but I wanted to know the answer too so here is the test:

alias: TestA
description: ""
triggers:
  - trigger: time
    at: "03:17:00"
    id: T1
  - trigger: time
    at: "03:17:00"
    id: T2
  - trigger: time
    at: "03:17:00"
    id: T3
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - T1
        sequence:
          - action: light.toggle
            target:
              entity_id: light.dining_ceiling_1
      - conditions:
          - condition: trigger
            id:
              - T2
        sequence:
          - action: light.toggle
            target:
              entity_id: light.dining_ceiling_2
      - conditions:
          - condition: trigger
            id:
              - T3
        sequence:
          - action: light.toggle
            target:
              entity_id: light.dining_ceiling_3
mode: parallel
max: 10

The answer is 3 separate runs each with a different trigger set.

1 Like

Thanks for that, interesting. Although how do you know it was 3 separate runs rather than a single run with each triggered option being executed.

This is relevant if the A/B condition block is used for each triggered option as that stops further execution if its condition is not met (at least that’s what the ‘instructions’ state) and seems to me that means the T2 and T3 options would never be executed.

I am not using that block, just the choice as in the example shown, but I’m interested in better understanding how HA behaves.

There will be separate debug Traces for each run.