State Condition For Specified Time

Not sure if this is an actual issue or I’m just not understanding the documentation for conditions… but I have an automation with the intent of checking whether the Inlet/Outlet temperature difference (delta T) on my air conditioner is where it should be, but I have a condition of the air conditioner needing to be running for 30 minutes (in order for my temperature sensors to settle down after startup). Here’s what I have:

trigger:
  - platform: template
    value_template: >-
      {{ states.sensor.hvac_inlet_df90_temperature.state | float -
      states.sensor.hvac_outlt_7f6c_temperature.state | float < 13 }}
condition:
  - condition: state
    entity_id: climate.home
    attribute: hvac_action
    for:
      hours: 0
      minutes: 30
      seconds: 0
    state: cooling

My reading of the documentation for conditions is that if this triggers AND the ‘hvac_action’ attribute has been in the state ‘cooling’ for at least 30 minutes (continuously, just like with triggers), it will proceed with the automation/actions. However, what it seems to be doing is using the cumulative time for the day. For instance, my A/C turned on for the first time earlier today and all worked as expected but then it JUST turned on again (see this graph with the blue block indicating cooling):
image

Yet when I test the condition, it returns True already and ran the automation:

Is this working as intended? If so, thoughts on the best approach to achieve what I’m after? Thanks a ton in advance!

The for criteria doesn’t work for attributes. The calculation of for is based on the last_changed property, which is specifically based on changes to the state. You will need to create a template sensor for hvac_action.

That makes PERFECT sense; thanks for the help and restoring my sanity! Template sensor created and automation updated.

I originally thought something along these lines might be the case, but the fact that the state ‘cool’ never changed threw me off.