Hi, I have tried different ways to stop my automation which is triggered by a folder_watcher firing more than once when motion is detected and a file or files are saved on my hard drive using ftp.
This attempt doesn’t do it neither. Any way of stopping this from happening please?
- alias: test motion
trigger:
platform: event
event_type: folder_watcher
event_data:
event_type: created
condition:
condition: template
value_template: '{{ (as_timestamp(now()) - as_timestamp(states.automation.test_motion.attributes.last_triggered | default(0)) | int > 300)}}'
action:
- service: input_boolean.turn_on
entity_id: input_boolean.motion_automation_active
- service: notify.ios_zzz_iphone
data_template:
message: 'motion {{ trigger.event.data.folder.split("/IPCamRecord/")[1].split("/")[0] }}'
data:
attachment:
url: 'http://zwhitfield.ddns.net:443/local/IPCamRecord/{{ trigger.event.data.folder.split("/IPCamRecord/")[1] }}/{{ trigger.event.data.file }}'
content-type: jpeg
hide-thumbnail: false
- delay:
minutes: 2
- service: input_boolean.turn_off
entity_id: input_boolean.motion_automation_active