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

Binary Sensor with multiple or conditions

$
0
0

Hi,

I’m trying to create a binary sensor with multiple or conditions. I don’t get any errors when reloading the config, but something isn’t right because the sensor status is stuck on unknown. Each condition works as an individual sensor.

  - binary_sensor:
      name: Person Detected
      off_delay: 90
      state_topic: "frigate/events"
      value_template: |-
        {{ if (value_json['after']['label'] == 'person' and value_json['after']['camera'] == 'dahua' and value_json['after']['score'] | float >= 0.7)
           or if (value_json['after']['label'] == 'person' and value_json['after']['camera'] == 'front' and value_json['after']['score'] | float >= 0.7)
           or if (value_json['after']['label'] == 'person' and value_json['after']['camera'] == 'rear' and value_json['after']['score'] | float >= 0.7)
           or if (value_json['after']['label'] == 'person' and value_json['after']['camera'] == 'reolink' and value_json['after']['score'] | float >= 0.7) }}

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106456

Trending Articles



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