Stupid question regarding triggering automations from the GUI

If I have an automation with a condition, if I trigger the automation manually by clicking on the automation via the configuration page and then clicking on the “trigger” link in the popup window, does it bypass the condition test and just execute the action logic? I’m trying to test a condition by clicking on the “trigger” link but it appears to me that the condition logic isn’t being executed when I run the automation this way.

Thanks!

Yes, the condition should still be valid. I had several that I tested that way (before moving them to Node-Red).

As far as I know if you trigger the automation it will execute the actions even if the conditions aren’t true.

You could test it by creating another automation with the same actions but a condition that is always false (such as a condition template with the value_template: {{“0”}} ) and trigger it.

1 Like

Yeah, that’s the behavior I’m seeing also. I’m fairly new to ha and the behavior is not what I was expecting, but now that I’m aware of it I can plan accordingly. Thanks.

Just a note. You can put the same conditions in the action section, they will functionally be the same except they won’t get skipped when you manually trigger the automation. You can do this for testing then put them back under “conditions” when you have everything working as expected.

Condition under “conditions” Condition gets skipped.

  - id: garage_climate_heat_temp_adjusted
    alias: "[Garage Climate] Heat Temp Adjusted"
    initial_state: 'on'

    trigger:
      # heat temperature has been adjusted
      - entity_id: input_number.garage_heat_temperature
        platform: state

    condition:
      # only run if heat boolean is on
      - condition: state
        entity_id: input_boolean.garage_heat
        state: 'on'

    action:
      # adjust the thermostat temperature
      - service: climate.set_temperature
        data_template:
          entity_id: climate.garage_thermostat
          temperature: "{{ states('input_number.garage_heat_temperature') | int}}"

Condition under “actions” Condition does not get skipped

  - id: garage_climate_heat_temp_adjusted
    alias: "[Garage Climate] Heat Temp Adjusted"
    initial_state: 'on'

    trigger:
      # heat temperature has been adjusted
      - entity_id: input_number.garage_heat_temperature
        platform: state

    action:
      # only run if heat boolean is on
      - condition: state
        entity_id: input_boolean.garage_heat
        state: 'on'

      # adjust the thermostat temperature
      - service: climate.set_temperature
        data_template:
          entity_id: climate.garage_thermostat
          temperature: "{{ states('input_number.garage_heat_temperature') | int}}"
1 Like

Good info, I didn’t realize this. I happen to have all of my Conditions under Actions (just because the hierarchical approach is easier for me to decipher) so I hadn’t encountered problems with manual triggering. This doesn’t seem to be cited anywhere in the documentation.