Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95365

Wait_template with dynamic timeout. Should this work?

$
0
0

@klogg wrote:

It is well documented elsewhere on this forum that I am not the best at working with times :rofl: :joy: :rofl:

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

Read full topic


Viewing all articles
Browse latest Browse all 95365

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>