@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