Hi, I have a Shelly 1 that I use to open and close the garage door, utilising the Shelly Integration, so the binary sensors and switches were automatically created. The reed switch that is used to monitor the garage door state results in a binary sensor, which reads “on” or “off”, as expected for a binary sensor.
Because I wanted to show the garage door in the Lovelace dashboard as “open” or “closed”, I created template sensor for the garage door state. The problem is that the sensor seems to bounce about 1/3 of the time, so the garage door shows as "open’ then immediately “closed” again although it is in fact still open. Bummer. I understand that I can add a “delay_off” setting for my own binary sensors which might alleviate the bounce scenario, except that the binary sensor is created by the Shelly Integration. How can I modify the template sensor to stop the garage door state from bouncing?
Here’s the existing template.
- platform: template
sensors:
garage_door_state:
friendly_name: "Garage Door State"
value_template: >-
{% if is_state('binary_sensor.shelly_shsw_1_f3a3c3_switch', 'on') %}
OPEN
{% else %}
Closed
{% endif %}
icon_template: >-
{% if is_state('binary_sensor.shelly_shsw_1_f3a3c3_switch', 'on') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
Thanks.