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

Template gives error in config.yaml

$
0
0

@ageurtse wrote:

Hello,

i’m trying to work with templats, what i want is do a count on my door and window contacts.

when i check the template in the template editor, it is working, but when pasting the code to the config.yaml. it won;t load.

what do i do wrong ?

sensors:
  - platform: template 
    sensors:
      contact_count:
        entity_id: sensor.count
        value_template: > 
          {% set binary_sensor = [
            states.binary_sensor.voordeur,
            states.binary_sensor.achterdeur,
            states.binary_sensor.raam_voor,
            states.binary_sensor.raam_achter,
            ] %}
          {{ binary_sensor | selectattr('state','eq','on') | list | count }}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95451

Trending Articles



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