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

Template does not trigger the condition

$
0
0

I have a problem with a template. In the events it works correctly and gives me true and false. In the automation, however, the condition always remains true. Do you have any tips?

{% set scenes = [
        'scene.wohnzimmer_naturliches_licht',
        'scene.wohnzimmer_herzliche_umarmung',
        'scene.wohnzimmer_glanz_und_glamour',
        'scene.wohnzimmer_disturbia',
        'scene.wohnzimmer_suzuka',
        'scene.wohnzimmer_lesen',
        'scene.wohnzimmer_nachtlicht',
        'scene.wohnzimmer_memento',
        'scene.wohnzimmer_witching_hour',
        'scene.wohnzimmer_ruhephase',
        'scene.wohnzimmer_konzentrieren',
        'scene.wohnzimmer_energie_tanken',
        'scene.wohnzimmer_entspannen',
        'scene.sonos_dashboard'
      ] %}
      {% set scene_aktiv = false %}
      {% for scene in scenes %}
        {% if (as_timestamp(now()) - as_timestamp(states[scene].last_changed)) < 600 %}
          {% set scene_aktiv = true %}
        {% endif %}
      {% endfor %}
      {{ scene_aktiv == false }}  # Gibt True zurück, wenn keine Szene aktiv ist

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106666

Trending Articles



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