Use only first trigger for notify? Ignore other triggers within xx seconds

Hi,

I am using a Fibaro Binary Sensor (Z-Wave) that i wired to my doorbell.
This works great, although i have one thing that i would like to change:
My packet delivery guy (and people that come over for a visit) often press the doorbell multiple times, which ends up in me receiving multiple notifications.

When i was using Domoticz i made a script for this, that stored the timestamp in a uservariable when the doorbell was pressed. When the doorbell was pressed again, it would check if the stored timestamp was more than 30s ago. If yes: send message, if not: do nothing.

But i am new to Home Assistant and have no idea how to realize this. Someone here with a good example?

Set a boolean to true when it rings. Send a notification when the boolean goes from false to true. Set the boolean to false when it has been true for x minutes.

That seems like a perfect solution.

/home/hass/.homeassistant/configuration/input_booleans.yaml:

doorbell_pressed: name: Doorbell pressed initial: off

/home/hass/.homeassistant/configuration/automation/017.doorbell_boolean_on.yaml:

`alias: 17 - Doorbell boolean on
trigger:

  • platform: state
    entity_id: binary_sensor.fibaro_system_fgbs001_universal_binary_sensor_sensor_15_2
    to: β€˜on’
    condition:
    condition: state
    entity_id: input_boolean.doorbell_pressed
    state: β€˜off’
    action:
  • service: homeassistant.turn_on
    entity_id:
    • input_boolean.doorbell_pressed
  • service: notify.telegramfrank
    data:
    title: Doorbell
    message: Someone rang the doorbell at {{now}}
    data:
    photo:
    - url: http://192.168.4.7/webcapture.jpg?command=snap&channel=1`

/home/hass/.homeassistant/configuration/automation/018.doorbell_boolean_off.yaml:

`alias: 18 - Doorbell boolean off
trigger:

  • platform: state
    entity_id: input_boolean.doorbell_pressed
    state: β€˜On’
    for:
    hours: 0
    minutes: 0
    seconds: 30
    action:
    service: homeassistant.turn_off
    entity_id:
    • input_boolean.doorbell_pressed`
1 Like