"Attribute of a state"-trigger in an automation

I have this code

alias: Huistemperatuur max 23 graden
description: ""
trigger:
  - platform: numeric_state
    entity_id: climate.ac
    attribute: current_temperature
    above: 23

and this is the attribute

Why is the automation not triggered ?

Triggers require a change. For your trigger to fire, the temperature has to change from below 23 to above 23. If the temperature is already above your set point when you save/load the automation the trigger will not fire until the temperature has dropped below the set point.

To test an automation there’s three stages you can follow. Testing the action, the condition and action, and the whole automation:

  1. Use ConfigurationAutomations to find the automation and then select Run in the three dots menu. If this fails your problem is in the action: section, and details should be found in your log file
  2. Use Developer toolsServices and call automation.trigger on the automation with skip_condition: false . If the first passes but this fails then the problem is in your condition: block
  3. Use Developer toolsStates to find the trigger entity, click the name, then change the state (at the top) to something that’ll trigger the automation before pushing Set State . If this fails then the problem is with your trigger: section, or the automation is turned off (you can check that in Automations, automations that are turned off will show Disabled ) You can also see this section in the docs about testing and automation traces.

You can add “startup” triggers and a condition to work around this:

alias: Huistemperatuur max 23 graden
description: ""
trigger:
  - platform: numeric_state
    entity_id: climate.ac
    attribute: current_temperature
    above: 23
  - platform: homeassistant
    event: start
  - platform: event
    event_type: automation_reloaded

condition:
  - condition: numeric_state
    entity_id: climate.ac
    attribute: current_temperature
    above: 23

That will fire when the temperature goes above 23; and also when restarted if the temperature is already above 23.

thanks guys for the help !