Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
114 lines (107 sloc) 3.26 KB
- alias: 'Trigger alarm while armed away'
trigger:
- platform: state
entity_id: binary_sensor.living_sensor_119
to: 'on'
- platform: state
entity_id: binary_sensor.gang_1ste_sensor_170
to: 'on'
- platform: state
entity_id: binary_sensor.gang_2de_sensor_159
to: 'on'
- platform: state
entity_id: binary_sensor.voordeur_200
to: 'on'
- platform: state
entity_id: binary_sensor.babyroom_sensor_216
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
- alias: 'Trigger alarm while armed home'
trigger:
- platform: state
entity_id: binary_sensor.voordeur_200
to: 'on'
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_home
action:
- service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.home_alarm
- alias: 'Activate alarm when away'
trigger:
- platform: state
entity_id: group.all_devices
to: 'not_home'
action:
- service: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.home_alarm
- alias: 'Activate alarm when asleep'
trigger:
- platform: state
entity_id: input_boolean.night_mode
to: 'on'
action:
- service: alarm_control_panel.alarm_arm_home
entity_id: alarm_control_panel.home_alarm
- alias: 'Deactivate alarm when home or awake'
trigger:
- platform: state
entity_id: group.all_devices
to: 'home'
- platform: state
entity_id: input_boolean.night_mode
to: 'off'
action:
- service: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.home_alarm
- alias: 'Reset alarm after triggered'
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: 'triggered'
for:
hours: 0
minutes: 0
seconds: 10
action:
- service_template: >
{% if is_state('input_boolean.night_mode', 'true') %}
alarm_control_panel.alarm_arm_home
{% else %}
alarm_control_panel.alarm_arm_away
{% endif %}
entity_id: alarm_control_panel.home_alarm
- alias: 'Notify of alarm'
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: 'triggered'
action:
- service: notify.all
data_template:
title: "*Inbraak alarm!*"
message: >
Activiteit op:
{% for state in states.binary_sensor -%}
{% if state.state == 'on' and state.name != 'Wasmachine' and state.name != 'Ping to Vera' %}
{{ state.name }}
{%- endif -%}
{% endfor %}
- service: notify.telegram_notify
data_template:
message: "Inbraak alarm"
data:
photo:
- url: "http://127.0.0.1:8123{{ states.camera.backyard.attributes.entity_picture }}"
caption: Backyard
- url: "http://127.0.0.1:8123{{ states.camera.frontyard.attributes.entity_picture }}"
caption: Frontyard
- url: "http://127.0.0.1:8123{{ states.camera.living.attributes.entity_picture }}"
caption: Living