How can the value of sensor.average_temp ever be less than 19.8? The automation’s Numeric State Trigger is configured to trigger only when the sensor’s value is greater than19.8.
If I want to add range such as: when temp 21-22 set delay to '00:00:05’, How will it look?
when temp 19-20 set delay to '00:00:04’
when temp 18-19 set delay to '00:00:03’
No, that’s an invalid use of the trigger variable and an improper use of the if statement.
The example I posted uses the trigger variable’s to_state property which exists when the automation is triggered by a Numeric State Trigger. Reference: Templating - Numeric State Trigger. The trigger variable doesn’t have a sensor property.
The Immediate If statement is written as iff and not as if whose usage and syntax is quite different.