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