1
0
Fork 0
ansible-home-assistant/scripts/11.cctv.yaml

83 lines
2.3 KiB
YAML

cctv_on:
alias: CCTV on
sequence:
- service: switch.turn_on
target:
entity_id:
- switch.usb_switch_3
- service: switch.turn_on
target:
entity_id:
- switch.living_room_recordings
- switch.living_room_snapshots
- switch.living_room_detect
- switch.hallway_recordings
- switch.hallway_snapshots
- switch.hallway_detect
cctv_off:
alias: CCTV off
sequence:
- service: switch.turn_off
target:
entity_id:
- switch.usb_switch_3
- service: switch.turn_off
target:
entity_id:
- switch.living_room_recordings
- switch.living_room_snapshots
- switch.living_room_detect
- switch.hallway_recordings
- switch.hallway_snapshots
- switch.hallway_detect
cctv_notify_hallway:
alias: CCTV notify hallway
sequence:
- service: notify.mobile_app_iphone
data:
title: "ALARM! Pending for disarm"
message: >
{{ state_attr(trigger.entity_id, 'friendly_name') }}
data:
entity_id: camera.hallway
url: "/lovelace-tablet/security"
- service: camera.snapshot
data:
filename: /config/www/cctv/hallway.jpg
target:
entity_id: camera.hallway
- service: notify.home_assistant
data:
title: "ALARM. Pending to disarm "
message: "Motion in hallway"
target: [ "1070507369164984372" ]
data:
images:
- "/config/www/cctv/hallway.jpg"
cctv_notify_living_room:
alias: CCTV notify living room
sequence:
- service: notify.mobile_app_iphone
data:
title: "ALARM! Pending for disarm"
message: >
{{ state_attr(trigger.entity_id, 'friendly_name') }}
data:
entity_id: camera.living_room
url: "/lovelace-tablet/security"
- service: camera.snapshot
data:
filename: /config/www/cctv/living_room.jpg
target:
entity_id: camera.hallway
- service: notify.home_assistant
data:
title: "ALARM. Pending to disarm "
message: "Motion in living room"
target: [ "1070507369164984372" ]
data:
images:
- "/config/www/cctv/living_room.jpg"