HIKVision - Binary Trigger inhibiting multiple triggers with a given time period

Hi,

I am using the HIKVision binary sensors to detect that someone’s at the front door or walking up the driveway. This does things like send notifications to Alexa, Apple iPhone and Watch and Switches on the hallway lights for 10 minutes.

However I want to stop multiple notifications if you are going in and out loading the car (for example), to do this I want to inhibit further notifications within a set time period (e.g. 5 minutes).

One of my Automations is posted below, but I can’t work out what I need in the script to mute the action for 5 minutes after each activation. Help would be appreciated as I’m not a great software guy - my specialism is hardware!

  • alias: Front Door Motion Hall Lights On
    initial_state: true
    trigger:
    platform: state
    entity_id: binary_sensor.front_door_motion_2
    to: ‘on’
    action:
    service: light.turn_on
    entity_id: light.hall_downlights

  • alias: Hall lights off 10 minutes after last movement
    trigger:
    platform: state
    entity_id: binary_sensor.front_door_motion_2
    to: ‘off’
    for:
    minutes: 10
    action:
    service: light.turn_off
    entity_id: light.hall_downlights

Plaese format your pasted code correctly.

This is how I do it for my lounge camera snapshot automation:

  condition:
  - condition: template # only every 5 minutes at most
    value_template:  "{{ (( as_timestamp(now()) - as_timestamp(state_attr('automation.lounge_camera_motion', 'last_triggered')) | int(0) ) / 60 ) > 5 }}"

I’ll give that a go! many thanks! I’ll report back later… Sorry about the pasted code, was in a hurry and could not seem to select the correct option.