summaryrefslogtreecommitdiffstats
path: root/blueprints/automation/camera/intrusion.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'blueprints/automation/camera/intrusion.yaml')
-rw-r--r--blueprints/automation/camera/intrusion.yaml91
1 files changed, 91 insertions, 0 deletions
diff --git a/blueprints/automation/camera/intrusion.yaml b/blueprints/automation/camera/intrusion.yaml
new file mode 100644
index 0000000..4d2b62c
--- /dev/null
+++ b/blueprints/automation/camera/intrusion.yaml
@@ -0,0 +1,91 @@
+blueprint:
+ name: Intrusion
+ description: Script to execute in case of intrusion, e.g. streaming photos from Security Camera
+ domain: automation
+ input:
+ sensors:
+ name: Sensors
+ description: Trigger on motion, open doors, etc.
+ default: []
+ selector:
+ entity:
+ multiple: true
+ domain: [ binary_sensor, light, switch ]
+ mode:
+ name: Mode
+ description: Switch enabling/disabling shooting
+ selector:
+ entity:
+ domain: input_boolean
+ arm_delay:
+ name: Arm Delay
+ description: Delay before 'Away' mode activated and intrusion detection is operational (to allow you leaving the flat)
+ default: 15
+ selector:
+ number:
+ min: 0
+ max: 60
+ unit_of_measurement: m
+ disarm_delay:
+ name: Disarm Delay
+ description: Delay before alarms triggered after motion is detected (to allow disarm on arrival), camera shots are made without delay
+ default: 5
+ selector:
+ number:
+ min: 0
+ max: 60
+ unit_of_measurement: m
+ camera_script:
+ name: camera_script
+ description: Streaming Script for Security Camera
+ default: []
+ selector:
+ action:
+ script:
+ name: script
+ description: Alarming scipt to issue notifications once intrusion is confirmed
+ default: []
+ selector:
+ action:
+
+trigger:
+ - platform: state
+ entity_id: !input "sensors"
+ to: 'on'
+
+condition:
+ - condition: state
+ entity_id: !input "mode"
+ state: 'on'
+ enabled: true
+ for:
+ hours: 0
+ minutes: !input arm_delay
+ seconds: 0
+
+variables:
+ disarm_delay: !input disarm_delay
+ disarm_delay_seconds: '{{ (( disarm_delay * 60 )) }}'
+
+mode: single
+action:
+ - parallel:
+ - choose: []
+ default: !input "camera_script"
+ - sequence:
+ - service: input_button.press
+ target:
+ entity_id: input_button.button_confirm
+ - wait_for_trigger:
+ - platform: state
+ entity_id: !input mode
+ to: 'off'
+ timeout: '{{ disarm_delay_seconds }}'
+ continue_on_timeout: true
+
+ - if:
+ - condition: template
+ value_template: '{{ wait.trigger == None }}'
+ then:
+ - choose: []
+ default: !input "script"