Dear all,
I want to create a binary sensor using the template integration. The state of this binary sensor should be changed to true when the value of a second sensor, a counter, changes. See below for what I have set in my configuration.yaml
file (you can ignore the first two sensor
entries, I include them for the sake of completeness). Although I get no errors anywhere, neither passage_sensor_right_left
nor passage_sensor_left_right
is created.
Any suggestions?
Thanks in advance.
template:
- sensor:
- name: "Living area Humidity"
unit_of_measurement: "%"
state: >
{% set h1 = states('sensor.thermostat_humidity') | float %}
{% set h2 = states('sensor.netatmo_indoor_module_humidity') | float %}
{{ ((h1 + h2) / 2) }}
unique_id: living_area_humidity
icon: "mdi:water-percent"
- sensor:
- name: "Living area Temperature"
unit_of_measurement: "°C"
state: >
{% set m1 = states('sensor.thermostat_temperature') | float %}
{% set m2 = states('sensor.netatmo_indoor_module_temperature') | float %}
{{ ((m1 + m2) / 2) }}
unique_id: living_area_temperature
icon: "mdi:thermometer"
- trigger:
- platform: state
entity_id: sensor.passage_sensor_passage_counter_value_ch3
binary_sensor:
- name: "Passage Dining Kitchen"
state: true
auto_off: 5 # s
icon: "mdi:eye"
unique_id: passage_sensor_left_right
- trigger:
- platform: state
entity_id: sensor.passage_sensor_passage_counter_value_ch2
binary_sensor:
- name: "Passage Kitchen Dining"
state: true
auto_off: 5 # s
icon: "mdi:eye"
unique_id: passage_sensor_right_left