Need help with an automation, please

I have an automation that won’t trigger. Could someone look at it and tell me what I did wrong?

alias: AC Limit - Downstairs
description: If the downstairs AC is set below NTE for 5 minutes, set it to Setpoint°.
trigger:
  - platform: template
    value_template: >-
      {{ state_attr('climate.downstairs', 'temperature') <
      states('input_number.downstairs_ac_nte') }}
    for:
      minutes: 2
condition:
  - condition: state
    entity_id: climate.downstairs
    state: cool
action:
  - service: climate.set_temperature
    data:
      temperature: "{{ states('input_number.downstairs_ac_setpoint') }}"
    target:
      entity_id: climate.downstairs
mode: single


input_number.downstairs_ac_setpoint is set to 77 and
input_number.downstairs_ac_nte is set to 75.
The thermostat is set to 74 (climate.downstairs, temperature attribute).

If I use a discrete value for below:

trigger:
  - platform: numeric_state
    entity_id: climate.downstairs
    for:
      hours: 0
      minutes: 5
      seconds: 0
    attribute: temperature
    below: 75

the automation triggers as expected.

What I am trying to do is to set the below: to a numeric helper entity value.

Any tips?

You template is probably comparing a string to a float…

trigger:
  - platform: template
    value_template: >-
      {{ state_attr('climate.downstairs', 'temperature') <
      states('input_number.downstairs_ac_nte') | float(0) }}
    for:
      minutes: 2

Also, be aware that triggers must change from false to true to fire… if the template renders true when you save the automation, it will not fire until the template renders false then changes to true.

Thanks for the assist. I was not aware of that. (Or I forgot).