@klogg wrote:
It is well documented elsewhere on this forum that I am not the best at working with times
If I want to implement a dynamic timeout in a
wait_template
, should this work?- wait_template: > {% set tnow = as_timestamp(now()) | int %} {% set timeout = states('input_number.wait_timeout') | int %} {% if timeout != 0 %} {{ is_state('sensor.some_sensor', 'some_state') or as_timestamp(now()) | int > tnow + timeout }} {% else %} {{ is_state('sensor.some_sensor', 'some_state') }} {% endif %}
Posts: 15
Participants: 3