WTH: Can't we see which trigger fired an automation?

I have many automatons with multiple triggers. It would help greatly to be able to see which trigger fired an automation when an automation triggers unexpectedly.

Had that situations as well! Good idea.

It is similar but not the same. The linked topic is about seeing what turned on a light (or some other entity).

This topic is about seeing which of a series of triggers in an automation made the automation fire. In the following automation I have several triggers:

- id: '9'
  alias: Bedtime detection
  trigger:
  - entity_id: 
    - group.motion_sensors
    - input_boolean.hold_lights
    for: 00:30:00
    platform: state
    to: 'off'
  - platform: state
    entity_id: input_boolean.party_mode
    to: 'off'
  - entity_id: binary_sensor.bayesian_bedtime
    platform: state
    to: 'on'
  - at: 
    - '22:00'
    - '22:30'
    platform: time
  action:
  - service: cover.close_cover
    entity_id: cover.all_shades
  - service: script.arm_alarm
  initial_state: True

I want to know which one of my triggers fired the automation. Was it the motion sensors? was it the Bayesian sensor? Was it the time trigger?

2 Likes

Great idea!

The trigger variable is available to the conditions & actions of the automation, but otherwise doesn’t show up directly anywhere. If it was added to the automation_triggered event it would at least show up in home-assistant.log, and maybe the Logbook.

Adding this to my to-do list…

8 Likes

A draft PR has been created:

Add description of what caused an automation trigger to fire

5 Likes

Speaking of this. I think what else would be awesome would be on the automation card itself it can show you the current conditions that are true/false that you have setup. Kinda like show you the flow and if its being blocked or not. Now imagine that while your building an automation in real time :slight_smile:

2 Likes