How to debug an automation condition?

Hello,

I’d like to use automation to turn on a switch every day during Spring and Fall.

So far, this is what I have:

- alias: Turn on switch
  trigger:
    - platform: time
      at: "13:50"
  condition:
    condition: or
    conditions:
      - condition: state
        entity_id: sensor.season
        state: Spring
      - condition: state
        entity_id: sensor.season
        state: Fall
  action:
    - service: switch.turn_on
      target:
        entity_id: switch.flush_1_relay

The season sensor shows Spring when I check in the UI but the switch is never turned on.

Is there a way to debug automation and see which condition was truthy or not?

Thank you

Check the actual state in the developer tools states menu. These states can be prettyfied for the frontend. I suspect the state may be all lowercase.

Also this will be a lot easier next month… :wink:

2 Likes

In the developer tools, it shows spring instead of Spring so you were right, we will see in a few minutes if it is triggered :wink:

Thank you!