Debounce a Binary-Sensor in HA?

I have a problem. I have a binary sensor connected to a burner of the heater. As soon as the burner starts, I get a clean 1 sent. But when the burner turns off, numerous 1’s and 0’s are sent within 2 seconds. Only after that comes the clean 0.

So it is a bounce problem.

Is there a way to debounce the sensor in Homeassistant?

I would create a template binary sensor then use an automation to change the new sensors state based on the heater sensors state.

In the automation I would would have it delay state change until state held >2seconds or whatever is needed. This also allows you to make it ON/OFF

If your concern is just automating when the burner is in or off, you could have the automation have that state for x seconds before firing too.

Could be an use case for the statistics sensor …

Which integration are you using for your binary sensor?

Some of them have options for debouncing.

I found a solution :slight_smile:

- platform: template
  sensors:
    brenner_heizung_status:
      value_template: "{{ is_state('sensor.brenner', '1') }}"
      delay_off:
        seconds: 2
      friendly_name: "Brenner Heizung"

If you had answered my question I could have told you that a week ago.