Trouble with my first automation (gree AC)

Good evening all,

I am trying my hand at my first automation.

What I am trying to achieve is to activate the Extra-Fan mode whenever my AC is on the “dry” or “cool” mode.

Unfortunately the automation does not run. When I run it manually and trace it, neither my trigger nor my “or” statement have run.

It’s not readily obvious to me what I’m doing wrong.

Here the yaml as it stands


id: '1656109912953'
alias: Extra-Fan ON
description: ''
trigger:
  - platform: state
    entity_id:
      - climate.1e466751
condition:
  - condition: or
    conditions:
      - condition: state
        entity_id: climate.1e466751
        attribute: hvac_modes
        state: dry
      - condition: state
        entity_id: climate.1e466751
        attribute: hvac_modes
        state: cool
action:
  - type: turn_on
    device_id: 64bfa1752510b1baf9d7130e80a621ed
    entity_id: switch.1e466751_xfan
    domain: switch
mode: single

Any help or pointers would be greatly appreciated.

when you run the automation manually neither trigger or conditions are processed. Only the the actions are run.

You can run the automation thru the dev tools services page and in the UI there you can tell it to not skip the conditions when you run it from there. But you will never be able to “run the triggers” when you run the automation manually.

If I remember correctly (I think) there is a way to test the logic of the triggers but I never use the UI to write automations so I don’t know if that is correct or I’m somehow making that all up.

In your conditions, this is not correct:

hvac_modes is a list of available modes that does not change. You just want the state. So remove the attribute lines:

condition:
  - condition: or
    conditions:
      - condition: state
        entity_id: climate.1e466751
        state: dry
      - condition: state
        entity_id: climate.1e466751
        state: cool

That was it, thanks a lot!