add alarm panel and alarms

This commit is contained in:
Florian Brinker 2019-10-13 18:07:18 +02:00
parent 9337092371
commit 1dc78dd88a
5 changed files with 91 additions and 14 deletions

46
automations/alarm.yaml Normal file
View File

@ -0,0 +1,46 @@
- alias: alarm disarm
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: 'disarmed'
action:
- service: notify.telegram_fb
data_template:
title: "*Alarm DEAKTIVIERT!*"
message: "Der Alarm wurde *deaktiviert*."
- service: script.shinobi_active
- alias: alarm pending
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: 'pending'
action:
- service: notify.telegram_fb
data_template:
title: "*Alarm wird aktiviert...*"
message: "Der Alarm wird in kürze scharf geschaltet!"
- alias: alarm away
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: 'armed_away'
action:
- service: notify.telegram_fb
data_template:
title: "*Alarm SCHARF!*"
message: "Der Alarm ist im *Unterwegs*-Modus."
- service: script.shinobi_active_with_motion
- alias: alarm night
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: 'armed_night'
action:
- service: notify.telegram_fb
data_template:
title: "*Alarm SCHARF!*"
message: "Der Alarm ist im *Nacht*-Modus."
- service: script.shinobi_active_with_motion

View File

@ -187,6 +187,12 @@ binary_sensor:
host: !secret desktop_ip
count: 2
scan_interval: 15
- platform: template
sensors:
cctv_active:
value_template: "{{ is_state('sensor.camera_mode_office', 'start') or is_state('sensor.camera_mode_office', 'recording') }}"
cctv_motion_detection_active:
value_template: "{{ (is_state('sensor.camera_mode_office', 'start') or is_state('sensor.camera_mode_office', 'recording')) and is_state('sensor.camera_motion_office', 'True') }}"
weather:
- platform: openweathermap
@ -214,6 +220,24 @@ input_datetime:
has_date: false
has_time: true
alarm_control_panel:
- platform: manual
name: Home Alarm
code: !secret alarm_code
code_arm_required: true
delay_time: 20
pending_time: 30
trigger_time: 120
disarm_after_trigger: false
disarmed:
trigger_time: 0
armed_home:
pending_time: 0
delay_time: 0
armed_night:
pending_time: 0
delay_time: 0
shell_command:
ssh: 'ssh -o "StrictHostKeyChecking=no" -i {{ sshkey }} {{ host }} -l {{ user }} -p {{ port }} {{ command_or_param }}'

View File

@ -4,10 +4,10 @@ cards:
- type: entities
show_header_toggle: false
entities:
- entity: switch.cctv_active
- entity: binary_sensor.cctv_active
name: Kameras aktiviert
icon: mdi:power
- entity: switch.cctv_motion_detection
- entity: binary_sensor.cctv_motion_detection_active
name: Aufnahmen bei Bewegung
icon: mdi:motion-sensor
- type: picture-glance
@ -15,7 +15,13 @@ cards:
camera_image: camera.office
camera_view: live
entities:
- entity: switch.cctv_motion_detection
- entity: binary_sensor.cctv_motion_detection_active
icon: mdi:motion-sensor
- entity: switch.cctv_active
- entity: binary_sensor.cctv_active
icon: mdi:power
- type: alarm-panel
name: Alarm
entity: alarm_control_panel.home_alarm
states:
- arm_away
- arm_night

View File

@ -1,8 +1,9 @@
- platform: rest
resource: !secret office_details_url
name: Camera Mode Office
value_template: '{{ value_json.mode }}'
- platform: rest
resource: !secret office_details_url
name: Camera Motion Office
value_template: '{{ value_json.details|string|regex_search("\"detector\":\"1\"", ignorecase=FALSE) }}'
- platform: rest
resource: !secret office_details_url
name: Camera Mode Office
value_template: '{{ value_json.mode }}'
- platform: rest
resource: !secret office_details_url
name: Camera Motion Office
value_template: '{{ value_json.details|string|regex_search("\"detector\":\"1\"", ignorecase=FALSE) }}'

View File

@ -115,7 +115,7 @@
cctv_motion_detection:
friendly_name: CCTV Motion Detection
value_template: "{{ (is_state('sensor.camera_mode_office', 'start') or is_state('sensor.camera_mode_office', 'recording')) and is_state('sensor.camera_motion_office', 'True') }}"
value_template: "{{ states('binary_sensor.cctv_motion_detection_active') }}"
turn_on:
service: script.shinobi_active_with_motion
turn_off:
@ -123,7 +123,7 @@
cctv_active:
friendly_name: CCTV Active
value_template: "{{ is_state('sensor.camera_mode_office', 'start') or is_state('sensor.camera_mode_office', 'recording') }}"
value_template: "{{ states('binary_sensor.cctv_active') }}"
turn_on:
service: script.shinobi_active
turn_off: