I’m trying to setup an automation using a value template trigger:
{% if is_state('climate.bedroom_ac', ['heat', 'fan_only', 'cool', 'dry', 'heat_cool'])%}true{% endif %}
for: 00:15:00
"If my Bedroom A/C is in any of these listed states, for X period of time, evaluate as True"
I can get the value template to work without for
, but my desired automation would require it.
I’m using almost the exact same syntax from the documentation for template triggers.
Here is the example code copied over:
automation:
trigger:
- platform: template
value_template: "{% if is_state('device_tracker.paulus', 'home') %}true{% endif %}"
# If given, will trigger when template remains true for X time.
for: "00:15:00"
I have tried using these different for
formats:
for:
hours: 0
minutes: 15
seconds: 0
for: "00:15:00"
for:
minutes: 15
I’ve gotten none of them to work.
I suspect the for
needs to be somewhere inside the if
block, but its shown that way in the docs and I’ve gotten errors when testing it out in the developer tools.