Check for state of the AC as trigger

Hi,

Best practice, do you think that there is a need to check the AC state as an automation trigger?

What I have today is:

trigger:
  - platform: numeric_state
    entity_id:
      - zone.home
    above: 0
  - platform: template
    value_template: "{{is_state('climate.midea_ac_1', 'off')}}"
  - platform: time
    at: "08:00:00"
    enabled: true
  - platform: numeric_state
    entity_id:
      - sensor.living_room_thermostat_temperature
    above: 80
    enabled: true

or should I just keep this as trigger

trigger:
  - platform: numeric_state
    entity_id:
      - zone.home
    above: 0
  - platform: time
    at: "08:00:00"
    enabled: true
  - platform: numeric_state
    entity_id:
      - sensor.living_room_thermostat_temperature
    above: 22
    enabled: true

and check ‘state’ as a condition

condition: template
value_template: "{{is_state('climate.midea_ac_1', 'off')}}"

Thank you

those are usually two very different things… so it depends on what you want.

add to the trigger if you want your actions to be run when the AC turns off

Add to conditions if you want the actions to run when the other triggers happen and the AC is already off.

It’s not about best practice. It’s about what behavior you want

@armedad

Thanks, I was thinking of the two ways but was unsure (newbie)… In my case it would be the latter.

1 Like

well… welcome… if you’re a newbie and want a jump start i’d really recommend you look at some of the stuff here… don’t be daunted by the quantity. scan the titles then skim the ones under automation. a little bit of time on that will save you hours and hours later: