From 86dbdfe0544fa026c6c32c485b8b34e6ed4fe64e Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Mon, 6 Feb 2023 03:20:38 +0100 Subject: [PATCH] Add camera in bedroom --- configuration/automations/alarm.yaml | 54 ++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/configuration/automations/alarm.yaml b/configuration/automations/alarm.yaml index 92c1500..f6615e9 100644 --- a/configuration/automations/alarm.yaml +++ b/configuration/automations/alarm.yaml @@ -140,6 +140,48 @@ images: - "/config/www/cctv/living_room.mp4" + +- id: alarm-away-bedroom + alias: '[Alarm] Trigger alarm when not at home (Bedroom)' + trigger: + # Use motion sensors + - platform: state + entity_id: binary_sensor.bedroom_motion_occupancy + to: 'on' + # Use open/close sensors + - platform: state + entity_id: binary_sensor.bedroom_window_open_close + to: 'on' + condition: + - condition: state + entity_id: alarm_control_panel.home_alarm + state: armed_away + action: + - service: alarm_control_panel.alarm_trigger + entity_id: alarm_control_panel.home_alarm + - service: camera.snapshot + data: + filename: /config/www/cctv/living_room.jpg + target: + entity_id: camera.hallway + - service: notify.home_assistant + data: + message: > + ALARM. Pending to disarm + Motion in Bedroom - {{ state_attr(trigger.entity_id, 'friendly_name') }} + @everyone + target: [ "1070507369164984372" ] + data: + images: + - "/config/www/cctv/bedroom.jpg" + - service: camera.record + data: + duration: 30 + lookback: 30 + filename: /config/www/cctv/bedroom.mp4 + target: + entity_id: camera.bedroom + - id: alarm-away-remaining alias: '[Alarm] Trigger alarm when not at home' trigger: @@ -147,16 +189,16 @@ - platform: state entity_id: binary_sensor.bathroom_motion_occupancy to: 'on' - - platform: state - entity_id: binary_sensor.bedroom_motion_occupancy - to: 'on' +# - platform: state +# entity_id: binary_sensor.bedroom_motion_occupancy +# to: 'on' - platform: state entity_id: binary_sensor.shower_motion to: 'on' # Use open/close sensors - - platform: state - entity_id: binary_sensor.bedroom_window_open_close - to: 'on' +# - platform: state +# entity_id: binary_sensor.bedroom_window_open_close +# to: 'on' condition: - condition: state entity_id: alarm_control_panel.home_alarm