How have you tested the automation? There is a good description of how triggers work and how to test the parts of an automation in the following thread:
Note that your automation will only trigger once, and that is when the temperature gets above 22 degs.
And that is probably way before 18:00.
(This is also explained in @Didgeridrew 's cookbook link )
So you should reverse trigger and condition…
trigger at 18:00
condition above 22
And then maybe a delay for 13 hours, but I think it is better to use an additional trigger at 09:00 to turn it off.
PS, you might also want to trigger on temp, but it is unlikely the temperature will still rise after 18:30 in the Netherlands
You could combine these in one automation (by using trigger ID’s), but it’s a lot easier to create 2 automations
But in case you decide to combine them, it might look something like this:
alias: "Turn AC on/off "
description: " But only if temperature is above 22"
trigger:
- platform: time
at: "07:00:00"
id: off_0700
- platform: time
at: "18:30:00"
id: on_1830
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- off_0700
sequence:
- action: climate.set_hvac_mode
target:
entity_id: climate.hvac2
data:
hvac_mode: "off"
- conditions:
- condition: trigger
id: on_1830
- condition: state
entity_id: group.people
state: home
sequence:
- alias: Turn on AC when room temp above 22
choose:
- conditions:
- condition: numeric_state
entity_id: climate.hvac2
attribute: current_temperature
above: 22
sequence:
- action: climate.set_hvac_mode
target:
entity_id:
- climate.hvac2
data:
hvac_mode: cool
- action: climate.set_temperature
target:
entity_id: climate.hvac2
data:
temperature: 22
mode: single
initial_state: true
(Note that this one has an additional condition; people need to be home