Hi,
I have a number of MQTT binary sensors with an off delay set to 10 seconds. This is being ignored though. I have another sensor with multiple or conditions set to 90 seconds which works with the correct off delay, but it is slow to trigger on even though one of the conditions is met.
- binary_sensor:
name: Front MQTT Dog & Score
off_delay: 10
state_topic: "frigate/events"
value_template: "{{ 'ON' if value_json['after']['label'] == 'dog' and value_json['after']['camera'] == 'front' and value_json['after']['score'] | float >= 0.7 else 'OFF' }}"
I have this binary sensor with 4 or conditions set with a 90 second delay which works as expected, but it’s only triggering on the first condition:
- binary_sensor:
name: Dog Detected
off_delay: 90
state_topic: "frigate/events"
value_template: >
{{ 'ON' if (value_json['after']['label'] == 'dog' and value_json['after']['camera'] == 'dahua' and value_json['after']['score'] | float >= 0.7)
or if (value_json['after']['label'] == 'dog' and value_json['after']['camera'] == 'front' and value_json['after']['score'] | float >= 0.7)
or if (value_json['after']['label'] == 'dog' and value_json['after']['camera'] == 'rear' and value_json['after']['score'] | float >= 0.7)
or if (value_json['after']['label'] == 'dog' and value_json['after']['camera'] == 'reolink' and value_json['after']['score'] | float >= 0.7) else 'OFF' }}