How to group a sensor that emits multiple on/off within few seconds?

I’m using a delay to debounce my doorbell:

# configuration.yaml

automation:
  - alias: Send notification if the door bell rings
    trigger:
      platform: state
      entity_id: binary_sensor.door_window_sensor_158d00015ae7a8
      from: 'on'
      to: 'off'
    condition:
      condition: state
      entity_id: script.debounce_door_bell
      state: 'off'
    action:
      service_template: script.debounce_door_bell

script:
  debounce_door_bell:
    sequence:
        - service: notify.html5
          data:
            title: Door bell
            message: The door bell rings!
        - delay: '00:00:10'

A input_boolean isn’t needed. The script has an “on” (running) and “off” state.

3 Likes