In order to reduce false alarm, I wanted to combine 2 other binary sensors in a template binary_sensor so that the template binary sensor is ON only when both binary sensors in value_template is ON. Here is my template binary_sensor…
- platform: template
sensors:
car_porch_intrusion:
friendly_name: 'Car Porch Intrusion'
sensor_class: 'motion'
value_template: >-
{%- if is_state("binary_sensor.carporch_motion_sensor", "on")
and is_state("binary_sensor.cam_1_field_detection", "on") -%}
on
{%- else -%}
off
{%- endif %}
entity_id:
- binary_sensor.carporch_motion_sensor
- binary_sensor.cam_1_field_detection
Unfortunately this is not working. When both binary_sensor.carporch_motion_sensor
and binary_sensor.cam_1_field_detection
are on
, the binary_sensor.car_porch_intrusion
remains off
.
Please help.