πŸ“ˆ Threshold helper enhancement: "delay" feature

I would love to use the Threshold sensor to detect if my smart plug power usage drops below a certain voltage. This can then tell me if my washing machine, dishwasher, robot vacuum, and robot lawnmower are active (on) or inactive (off). The problem is sometimes these devices have quick sudden power drops or power spikes while active.

It would be ideal if we can set a β€œdelay” value which would tell the system to wait before changing the threshold sensor state. The input sensor then needs to be above or below the threshold for a certain amount of time for the threshold boolean updates. This could allow a custom way to eliminate anomalies in threshold sensors.

Then I can reliably send push notifications when they are done with their task for the day :grinning_face_with_smiling_eyes: #robots

FYI: if you don’t get your WTH wish this can be accomplished with the template binary sensor.

template:
  - binary_sensor:
      - name: "Dishwasher Running"
        icon: "mdi:dishwasher"
        state: "{{ states('sensor.dishwasher_power')|float(0) > 20 }}"
        device_class: moving
        delay_off:
          minutes: 5
        delay_on:
          minutes: 1
4 Likes

Some other options that can indirectly satisfy this which I use:

  1. if the sensors value increases/decreases slowly and steadily the hysteresis option can serve as an on/off delay. Since it prevents it from changing state until it has moved a certain amount past your threshold.
  2. if the sensor is very spike-y (like a power or illuminance sensor tends to be) can use a filter sensor to smooth it out and slow it down so crossing the threshold and/or hysteresis is more meaningful

But still, I like the WTH, I would definitely use this :+1: