I have this automation:
- id: '1583753653792'
alias: motion
description: ''
trigger:
- entity_id: binary_sensor.bolt_lepcso
platform: state
to: 'on'
condition: []
action:
- data:
message: Motion detected.
service: notify.telegram
Working good but send a lot of message what is not important.
Need that if motion detected send asap only one message, but after for 2 minutes no send another message even motion detected.
Nobody helped, but I found a solution.
So this is working for me:
in configuration.yaml
input_boolean:
notify_motion:
name: Notify When Motion Detected
initial: off
and in automations.yaml
- id: '1584356683537'
alias: motion
description: ''
trigger:
- entity_id: binary_sensor.bolt_lepcso
platform: state
to: 'on'
condition: []
action:
- data: {}
entity_id: input_boolean.notify_motion
service: input_boolean.turn_on
- id: '1584356998994'
alias: Message after motion
description: ''
trigger:
- entity_id: input_boolean.notify_motion
platform: state
to: 'on'
condition: []
action:
- data:
message: Motion detected!
service: notify.telegram
- delay: 00:02:00
- data: {}
entity_id: input_boolean.notify_motion
service: input_boolean.turn_off