I’m trying to combine a numeric less than condition, with a “for 5 minutes” clause, but it seems like “for” can only be used with “state” conditions.
What I’m trying to achieve is that for every value change, where the value hasn’t been above a threshold for a period of time, I want to save that value to an input_slider. That way, when the value goes above the range, the saved value in the input_slider is the goal to return to.
I’ve tried:
- condition: numeric_state
entity_id: sensor.sn1_humidity_delta
below: 1
for:
minutes: 5
And I’ve tried:
- condition: template
value_template: '{{ states.sensor.sn1_humidity_delta.state < 1.0 }}'
for:
minutes: 5
Both complain about the “for”, with an error along the lines of:
ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: extra keys not allowed @ data['condition'][0]['conditions'][1]['for']. Got None
I could probably add an input_boolean to update with the “state” result of the numerical check, and then use that for the “for 5 minutes” condition, but that seems clunky. Is there any way to represent it without resorting to more input variables?
It would be useful if “numeric_state” and “template” type conditions could use the “for” syntax.
Thanks!