Automation triggered but "when" conditions not met, what caused it?

Hi all

I have an automation script that turns all lights on and flashes them different colours, and turns camera sirens on, if a door switch is detected as open on any door, between the hours of 1am - 7am:

alias: Intruder Alert
description: ""
triggers:
  - type: opened
    device_id: 7d33588875ea784e30e780b0a32e0848
    entity_id: 0d9968874976bd9da433df5d08f8c3a9
    domain: binary_sensor
    trigger: device
  - type: opened
    device_id: 576e90acc854873b70fd08e609454c0f
    entity_id: 7e979e3ead5f12cd70ab4af28c5d9767
    domain: binary_sensor
    trigger: device
  - type: opened
    device_id: 6d641d563841bf025f29d4fd1241c4de
    entity_id: 052f02268f9ecd1164d91a8d40726af9
    domain: binary_sensor
    trigger: device
conditions:
  - condition: time
    after: "01:00:00"
    before: "07:00:00"
    enabled: true
  - condition: not
    conditions:
      - condition: zone
        entity_id: device_tracker.sm_s901b
        zone: zone.home
    enabled: false
actions:
  - type: turn_on
    device_id: 6d0ff2236ef7c0d135ffddd9b7bc66d4
    entity_id: afe9eaa4cfd78a7dcc897e1fbfb2bc27
    domain: switch
  - type: turn_on
    device_id: 480f9ecef6718f12c3a0996f6a1f625a
    entity_id: ac9a490728c76b9ce9eb3d4cdf03c766
    domain: switch
  - type: turn_on
    device_id: ba097e555282058a5b6a274b9af43a77
    entity_id: 49cded21d8a691794ad493b25340371c
    domain: switch
  - action: light.turn_on
    metadata: {}
    data: {}
    target:
      device_id:
        - 5d18cc6411c3011811c57905b7df28a1
        - 1dd16dfb2f6aca4b6ca80ecede155c0f
        - 732ce499ec2604a4c1486274abcfa6c4
        - d0c01f80f8fcd622071bb4181408bec1
        - 948a8698ae619f8ce6f8fbc9870527d6
        - abfb96da3df6b62c78114bc3ac9e154e
  - repeat:
      sequence:
        - action: light.turn_on
          metadata: {}
          data:
            rgb_color:
              - 255
              - 0
              - 0
            flash: long
            brightness_pct: 100
          target:
            device_id:
              - 5d18cc6411c3011811c57905b7df28a1
              - 1dd16dfb2f6aca4b6ca80ecede155c0f
              - 732ce499ec2604a4c1486274abcfa6c4
              - d0c01f80f8fcd622071bb4181408bec1
              - 948a8698ae619f8ce6f8fbc9870527d6
              - abfb96da3df6b62c78114bc3ac9e154e
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            rgb_color:
              - 0
              - 0
              - 255
            brightness_pct: 100
            flash: long
          target:
            device_id:
              - 5d18cc6411c3011811c57905b7df28a1
              - 1dd16dfb2f6aca4b6ca80ecede155c0f
              - 732ce499ec2604a4c1486274abcfa6c4
              - d0c01f80f8fcd622071bb4181408bec1
              - 948a8698ae619f8ce6f8fbc9870527d6
              - abfb96da3df6b62c78114bc3ac9e154e
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
      while:
        - condition: state
          entity_id: input_boolean.all_sirens_off
          state: "off"
mode: single

This keeps getting triggered even though no doors have been opened. When I check the trace it shows this:

I see that the first item has this info populated under the Changed Variables. What does this variable change mean exactly? Which variable was changed and how?

I assumed automation cannot trigger if the When conditions are not met so how is this happening? Any help greatly appreciated.

Cheers

When an automation is triggered by one of its triggers, its trace shows a highlighted path starting from the trigger. For example, in the following trace, the highlighted path begins at the third trigger.

In your trace, there’s no path beginning from one of the three triggers. The path starts halfway through the trace, beyond the automation’s triggers and conditions.

Your trace implies this automation was not triggered by one of its three triggers but was executed by another automation, or script, using the automation.trigger action.

This action skips an automation’s triggers and conditions section and simply executes its actions section. The same result occurs if you manually execute the automation’s “Run Actions” command.

Find the other automation that executes this one.


EDIT

Another clue that this automation was executed by another one is that the context object’s id and parent_id have values but its user_id is null.

image

That’s the “fingerprint” of an external influence like an automation.

1 Like

In addition to Taras’ answer above, be aware that a user manually firing the automation by clicking the “Run/Run Actions” option in the automation’s overflow menu will also produce a trace like that.

1 Like

Any progress to report?