Compare commits
2 Commits
d49f17b5a7
...
5d2e6da052
Author | SHA1 | Date | |
---|---|---|---|
5d2e6da052 | |||
1f269e7ecc |
@ -39,9 +39,9 @@
|
|||||||
- service: notify.home_assistant
|
- service: notify.home_assistant
|
||||||
data:
|
data:
|
||||||
message: >
|
message: >
|
||||||
ALARM. Pending to disarm
|
ALARM. Pending to disarm
|
||||||
Motion in hallway - {{ state_attr(trigger.entity_id, 'friendly_name') }}
|
Motion in hallway - {{ state_attr(trigger.entity_id, 'friendly_name') }}
|
||||||
@everyone
|
@everyone
|
||||||
target: [ "1070507369164984372" ]
|
target: [ "1070507369164984372" ]
|
||||||
data:
|
data:
|
||||||
images:
|
images:
|
||||||
@ -72,12 +72,12 @@
|
|||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.office_sensor_motion
|
entity_id: binary_sensor.office_sensor_motion
|
||||||
to: 'on'
|
to: 'on'
|
||||||
# - platform: state
|
# - platform: state
|
||||||
# entity_id: binary_sensor.kitchen_tabletop_motion_detection
|
# entity_id: binary_sensor.kitchen_tabletop_motion_detection
|
||||||
# to: 'on'
|
# to: 'on'
|
||||||
# - platform: state
|
# - platform: state
|
||||||
# entity_id: binary_sensor.kitchen_sink_motion_sensor
|
# entity_id: binary_sensor.kitchen_sink_motion_sensor
|
||||||
# to: 'on'
|
# to: 'on'
|
||||||
# Use open/close sensors
|
# Use open/close sensors
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.dining_window_1_open_close
|
entity_id: binary_sensor.dining_window_1_open_close
|
||||||
@ -108,7 +108,7 @@
|
|||||||
{{ state_attr(trigger.entity_id, 'friendly_name') }}
|
{{ state_attr(trigger.entity_id, 'friendly_name') }}
|
||||||
data:
|
data:
|
||||||
entity_id: camera.living_room
|
entity_id: camera.living_room
|
||||||
url: "/lovelace-tablet/security"
|
url: "/lovelace-tablet/security"
|
||||||
- service: camera.snapshot
|
- service: camera.snapshot
|
||||||
data:
|
data:
|
||||||
filename: /config/www/cctv/living_room.jpg
|
filename: /config/www/cctv/living_room.jpg
|
||||||
@ -196,16 +196,16 @@
|
|||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.bathroom_motion_occupancy
|
entity_id: binary_sensor.bathroom_motion_occupancy
|
||||||
to: 'on'
|
to: 'on'
|
||||||
# - platform: state
|
# - platform: state
|
||||||
# entity_id: binary_sensor.bedroom_motion_occupancy
|
# entity_id: binary_sensor.bedroom_motion_occupancy
|
||||||
# to: 'on'
|
# to: 'on'
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.bathroom_shower_sensor_motion
|
entity_id: binary_sensor.bathroom_shower_sensor_motion
|
||||||
to: 'on'
|
to: 'on'
|
||||||
# Use open/close sensors
|
# Use open/close sensors
|
||||||
# - platform: state
|
# - platform: state
|
||||||
# entity_id: binary_sensor.bedroom_window_open_close
|
# entity_id: binary_sensor.bedroom_window_open_close
|
||||||
# to: 'on'
|
# to: 'on'
|
||||||
condition:
|
condition:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: alarm_control_panel.home_alarm
|
entity_id: alarm_control_panel.home_alarm
|
||||||
@ -219,29 +219,7 @@
|
|||||||
message: >
|
message: >
|
||||||
{{ state_attr(trigger.entity_id, 'friendly_name') }}
|
{{ state_attr(trigger.entity_id, 'friendly_name') }}
|
||||||
data:
|
data:
|
||||||
url: "/lovelace-tablet/security"
|
url: "/lovelace-tablet/security"
|
||||||
|
|
||||||
- id: alarm_away_test_vibration
|
|
||||||
alias: '[Alarm] Window vibration test'
|
|
||||||
trigger:
|
|
||||||
- platform: state
|
|
||||||
entity_id: binary_sensor.office_vibration
|
|
||||||
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: notify.mobile_app_iphone
|
|
||||||
data:
|
|
||||||
title: "Vibration Test ALARM!"
|
|
||||||
message: >
|
|
||||||
{{ state_attr(trigger.entity_id, 'friendly_name') }}
|
|
||||||
data:
|
|
||||||
entity_id: camera.living_room
|
|
||||||
url: "/lovelace-tablet/security"
|
|
||||||
|
|
||||||
- id: alarm_night
|
- id: alarm_night
|
||||||
alias: '[Alarm] Trigger alarm at night'
|
alias: '[Alarm] Trigger alarm at night'
|
||||||
@ -277,7 +255,7 @@
|
|||||||
message: >
|
message: >
|
||||||
{{ state_attr(trigger.entity_id, 'friendly_name') }}
|
{{ state_attr(trigger.entity_id, 'friendly_name') }}
|
||||||
data:
|
data:
|
||||||
url: "/lovelace-tablet/security"
|
url: "/lovelace-tablet/security"
|
||||||
|
|
||||||
- id: alarm_arm_away
|
- id: alarm_arm_away
|
||||||
alias: '[Alarm] Arm away'
|
alias: '[Alarm] Arm away'
|
||||||
@ -287,8 +265,7 @@
|
|||||||
zone: zone.home
|
zone: zone.home
|
||||||
event: leave
|
event: leave
|
||||||
action:
|
action:
|
||||||
- service: alarm_control_panel.alarm_arm_away
|
- service: script.alarm_arm_away
|
||||||
entity_id: alarm_control_panel.home_alarm
|
|
||||||
|
|
||||||
- id: alarm_pending
|
- id: alarm_pending
|
||||||
alias: '[Alarm] Send notification when alarm triggered'
|
alias: '[Alarm] Send notification when alarm triggered'
|
||||||
|
@ -31,10 +31,8 @@
|
|||||||
entity_id: alarm_control_panel.home_alarm
|
entity_id: alarm_control_panel.home_alarm
|
||||||
state: 'armed_home'
|
state: 'armed_home'
|
||||||
sequence:
|
sequence:
|
||||||
- service: alarm_control_panel.alarm_disarm
|
- service: script.alarm_disarm
|
||||||
entity_id: alarm_control_panel.home_alarm
|
- service: script.alarm_arm_away
|
||||||
- service: alarm_control_panel.alarm_arm_away
|
|
||||||
entity_id: alarm_control_panel.home_alarm
|
|
||||||
|
|
||||||
- id: vacuum_daily_reset
|
- id: vacuum_daily_reset
|
||||||
alias: '[Vacuum] Reset daily cleaning'
|
alias: '[Vacuum] Reset daily cleaning'
|
||||||
|
@ -236,6 +236,7 @@ influxdb:
|
|||||||
alarm_control_panel:
|
alarm_control_panel:
|
||||||
- platform: manual
|
- platform: manual
|
||||||
name: Home Alarm
|
name: Home Alarm
|
||||||
|
code: !secret alarm_code
|
||||||
delay_time: 30
|
delay_time: 30
|
||||||
arming_time: 30
|
arming_time: 30
|
||||||
trigger_time: 120
|
trigger_time: 120
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
- hosts: home-assistant
|
- hosts: home-assistant
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Include secrets
|
||||||
|
include_vars:
|
||||||
|
file: configuration/secrets.yaml
|
||||||
- name: Remove automations directory
|
- name: Remove automations directory
|
||||||
file:
|
file:
|
||||||
path: '{{ pwd_config }}/automations'
|
path: '{{ pwd_config }}/automations'
|
||||||
@ -125,6 +128,11 @@
|
|||||||
dest: './scripts/check-unavailable.yaml'
|
dest: './scripts/check-unavailable.yaml'
|
||||||
vars:
|
vars:
|
||||||
entities: "{{ availability }}"
|
entities: "{{ availability }}"
|
||||||
|
- name: Build alarm script
|
||||||
|
delegate_to: localhost
|
||||||
|
template:
|
||||||
|
src: scripts/alarm.yaml.j2
|
||||||
|
dest: './scripts/alarm.yaml'
|
||||||
- name: Concat scripts
|
- name: Concat scripts
|
||||||
ansible.builtin.assemble:
|
ansible.builtin.assemble:
|
||||||
remote_src: no
|
remote_src: no
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
tasks:
|
|
||||||
- name: Build lights automations
|
|
||||||
template:
|
|
||||||
src: lights.yaml.j2
|
|
||||||
dest: configuration/automations/lights.yaml
|
|
||||||
vars:
|
|
||||||
lights:
|
|
||||||
- entityId: light.bathroom_lights
|
|
||||||
name: Bathroom Lights
|
|
||||||
- entityId: light.kitchen_lights
|
|
||||||
name: Kitchen Lights
|
|
||||||
- entityId: light.shower_lights
|
|
||||||
name: Shower Lights
|
|
||||||
- entityId: light.couch_lights
|
|
||||||
name: Couch Lights
|
|
||||||
- entityId: light.desk_lightbar
|
|
||||||
name: Desk Lightbar
|
|
||||||
- entityId: light.office
|
|
||||||
name: Office lamp
|
|
||||||
- name: Concat scripts
|
|
||||||
ansible.builtin.assemble:
|
|
||||||
src: scripts
|
|
||||||
dest: configuration/scripts.yaml
|
|
@ -18,10 +18,8 @@ vacuum_today:
|
|||||||
entity_id: alarm_control_panel.home_alarm
|
entity_id: alarm_control_panel.home_alarm
|
||||||
state: 'arming'
|
state: 'arming'
|
||||||
sequence:
|
sequence:
|
||||||
- service: alarm_control_panel.alarm_disarm
|
- service: script.alarm_disarm
|
||||||
entity_id: alarm_control_panel.home_alarm
|
- service: script.alarm_arm_stay
|
||||||
- service: alarm_control_panel.alarm_arm_home
|
|
||||||
entity_id: alarm_control_panel.home_alarm
|
|
||||||
- service: vacuum.start
|
- service: vacuum.start
|
||||||
entity_id: vacuum.valetudo_valetudos5
|
entity_id: vacuum.valetudo_valetudos5
|
||||||
|
|
||||||
|
26
templates/scripts/alarm.yaml.j2
Normal file
26
templates/scripts/alarm.yaml.j2
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
alarm_arm_stay:
|
||||||
|
alias: '[Alarm] arm stay'
|
||||||
|
mode: single
|
||||||
|
icon: mdi:weather-night
|
||||||
|
sequence:
|
||||||
|
- service: alarm_control_panel.alarm_arm_home
|
||||||
|
entity_id: alarm_control_panel.home_alarm
|
||||||
|
data:
|
||||||
|
code: "{{ alarm_code }}"
|
||||||
|
|
||||||
|
alarm_arm_away:
|
||||||
|
alias: '[Alarm] arm away'
|
||||||
|
mode: single
|
||||||
|
sequence:
|
||||||
|
- service: alarm_control_panel.alarm_arm_away
|
||||||
|
entity_id: alarm_control_panel.home_alarm
|
||||||
|
data:
|
||||||
|
code: "{{ alarm_code }}"
|
||||||
|
|
||||||
|
alarm_disarm:
|
||||||
|
alias: '[Alarm] disarm'
|
||||||
|
sequence:
|
||||||
|
- service: alarm_control_panel.alarm_disarm
|
||||||
|
entity_id: alarm_control_panel.home_alarm
|
||||||
|
data:
|
||||||
|
code: "{{ alarm_code }}"
|
Loading…
Reference in New Issue
Block a user