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

MQTT binary sensors ignoring off_delay

$
0
0

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' }}"

image

I have this binary sensor with 4 or conditions set with a 90 second delay which works as expected, but it’s slow to trigger:

  - 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' }}

image

I have seperate sensors to monitor the score and you can see the delay:

image

image

image

image

It should have triggered at 19:31:50, but it didn’t trigger until 7 seconds later:

image

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106764

Trending Articles