Files
Home-Assistant/automations/03_presence_and_security/03a_presence_and_security.yaml
T

89 lines
3.5 KiB
YAML
Raw Normal View History

# # One controller owns the Blink group and its cameras' motion detection.
# - id: '1758196295864'
# alias: Inside Blink Cameras - Reconcile Family Presence
# description: >-
# Disarm when either parent is home. Enable camera motion detection and arm
# only when both trackers have valid away states. Reconcile on startup,
# automation reload and Blink recovery; unknown location never means away.
# triggers:
# - trigger: state
# entity_id:
# - device_tracker.joshuas_iphone_of_pain
# - device_tracker.pollys_iphone
# to: null
# - trigger: homeassistant
# event: start
# - trigger: event
# event_type: automation_reloaded
# - trigger: state
# entity_id: alarm_control_panel.blink_inside
# to:
# - armed_away
# - disarmed
# conditions: []
# actions:
# - choose:
# - conditions:
# - condition: template
# value_template: >-
# {{ is_state('device_tracker.joshuas_iphone_of_pain', 'home')
# or is_state('device_tracker.pollys_iphone', 'home') }}
# sequence:
# - if:
# - condition: template
# value_template: >-
# {{ has_value('alarm_control_panel.blink_inside')
# and not is_state('alarm_control_panel.blink_inside', 'disarmed') }}
# then:
# - action: alarm_control_panel.alarm_disarm
# continue_on_error: true
# target:
# entity_id: alarm_control_panel.blink_inside
# # Recheck after the network action, before changing camera settings.
# - condition: template
# value_template: >-
# {{ is_state('device_tracker.joshuas_iphone_of_pain', 'home')
# or is_state('device_tracker.pollys_iphone', 'home') }}
# - action: camera.disable_motion_detection
# continue_on_error: true
# target:
# device_id:
# - 3df00a0796efe006e4ea349a9752faba
# - 0c13483d761efe3b85e534fadd323fe3
# - 5aa158596e48441ea606dd881a34402d
# - d045a0a68c3c4d52a7beb2a28fdf6993
# - 044c43ea05ceff58b1209f6441c24183
# - conditions:
# - condition: template
# value_template: >-
# {{ states('device_tracker.joshuas_iphone_of_pain')
# not in ['home', 'unknown', 'unavailable', '']
# and states('device_tracker.pollys_iphone')
# not in ['home', 'unknown', 'unavailable', '']
# and has_value('alarm_control_panel.blink_inside') }}
# sequence:
# - action: camera.enable_motion_detection
# # One unavailable camera must not prevent arming the rest of the group.
# continue_on_error: true
# target:
# device_id:
# - 3df00a0796efe006e4ea349a9752faba
# - 0c13483d761efe3b85e534fadd323fe3
# - 5aa158596e48441ea606dd881a34402d
# - d045a0a68c3c4d52a7beb2a28fdf6993
# - 044c43ea05ceff58b1209f6441c24183
# - condition: template
# value_template: >-
# {{ states('device_tracker.joshuas_iphone_of_pain')
# not in ['home', 'unknown', 'unavailable', '']
# and states('device_tracker.pollys_iphone')
# not in ['home', 'unknown', 'unavailable', ''] }}
# - if:
# - condition: template
# value_template: "{{ not is_state('alarm_control_panel.blink_inside', 'armed_away') }}"
# then:
# - action: alarm_control_panel.alarm_arm_away
# target:
# entity_id: alarm_control_panel.blink_inside
# mode: restart