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 could be doing something wrong, but VS Code is throwing an error for delay_off when making a template. (Home Assistant V2023.2.3, code-server: v4.9.1). I copy/pasted the code by Tomac84 into my configuration.yaml, checked the documentation on templates here: Template - Home Assistant, used their examples, and still get an error.
I wanted to post an alternative solution incase anyone else is running into this same issue.
### Michael Iphone Ping Debounce ###
- platform: template
sensors:
v_precence_michael:
friendly_name: "V Presence Michael"
value_template: >-
{% if is_state('device_tracker.v_michael_phone_ping', 'home') %}
home
{% elif as_timestamp(now()) - as_timestamp(states.device_tracker.v_michael_phone_ping.last_changed) > 1020 %}
away
{% else %}
home
{% endif %}
If anyone has advice on how I am using delay_off incorrectly or if it is depreciated, it would be helpful.