This sort of thing is much easier to implement & debug in NodeRed IMHO. I have mine linked into presence so it only heats if the house is occupied otherwise it goes into a standby that stops the house from freezing.
It looks like you are setting the thermostat to 22 and then as soon as it reaches 20 you are asking it to set to 15, it will never reach the target?
A Numeric State Trigger is triggered when the value rises above the threshold. In other words, when the value crosses the threshold. If the value is already above the threshold (like 20.3), it won’t trigger.
Replace the wait_for_trigger with a wait_templateand the Numeric State Trigger with a Numeric State Condition.EDITNo. It must be a template. See follow-up post below.
Example (contains an error)
- wait_template:
# This is invalid ...
- condition: numeric_state
attribute: current_temperature
above: '20'
entity_id: climate.bedroom
I assume you realize that if the temperature is 20.3 at 09:45:00, the automation will set the bedroom thermostat to 22 and then immediately set it to 15.
That’s due to my mistake. In an attempt to make it an easy change for you, I overlooked the fact it must be a template (after all, it’s a wait_template).