Improved security automations across the board

This commit is contained in:
2022-12-05 18:15:03 -05:00
parent 4ef79b5d5a
commit f23d4016b0

View File

@ -183,40 +183,36 @@ automation:
from: "off" from: "off"
to: "on" to: "on"
action: action:
- if: - service: scene.create
- condition: state data:
entity_id: light.living_room_lights scene_id: light_state_before_lockdown_issue
state: 'on' snapshot_entities:
then: - light.living_room_color_1
- service: switch.turn_off - light.living_room_color_2
target: - light.living_room_color_3
entity_id: switch.adaptive_lighting_living_room - light.tina_lamp_side
- service: light.turn_on - light.tina_lamp_top
target: - delay:
entity_id: light.living_room_lights seconds: 1
data: - service: switch.turn_off
color_name: red target:
brightness_pct: 100 entity_id:
- if: - switch.adaptive_lighting_living_room
- condition: state - switch.adaptive_lighting_tina_lamp
entity_id: light.tina_lamp - service: light.turn_on
state: 'on' target:
then: entity_id:
- service: switch.turn_off - light.living_room_lights
target: - light.tina_lamp
entity_id: switch.adaptive_lighting_tina_lamp data:
- service: light.turn_on color_name: red
target: brightness_pct: 100
entity_id: light.tina_lamp
data:
color_name: red
brightness_pct: 100
- service: script.status_annc - service: script.status_annc
data_template: data_template:
who: common who: common
call_interruption: 1 call_interruption: 1
call_lockdown_issue: 1 call_lockdown_issue: 1
- wait_template: "{{ is_state('sensor.total_faults','0') }}" - wait_template: "{{ is_state('binary_sensor.security_faults','off') }}"
timeout: timeout:
minutes: 10 minutes: 10
- service: input_boolean.turn_off - service: input_boolean.turn_off
@ -226,8 +222,8 @@ automation:
seconds: 3 seconds: 3
- if: - if:
- condition: state - condition: state
entity_id: sensor.total_faults entity_id: binary_sensor.security_faults
state: '0' state: 'off'
then: then:
- if: - if:
- condition: state - condition: state
@ -246,26 +242,16 @@ automation:
data: data:
who: common who: common
message: 'I am unable to resolve the security issue, so I am giving up. Please report the issue to Tony if applicable.' message: 'I am unable to resolve the security issue, so I am giving up. Please report the issue to Tony if applicable.'
- if: - service: scene.turn_on
- condition: state target:
entity_id: light.living_room_lights entity_id: scene.light_state_before_lockdown_issue
state: 'on' - delay:
then: seconds: 3
service: input_select.select_option - service: switch.turn_on
target: target:
entity_id: input_select.living_room_scenes entity_id:
data: - switch.adaptive_lighting_living_room
option: Adaptive - switch.adaptive_lighting_tina_lamp
- if:
- condition: state
entity_id: light.tina_lamp
state: 'on'
then:
- service: input_select.select_option
target:
entity_id: input_text.tina_lamp_selected_scene
data:
option: Adaptive
script: script:
security_arm_home: security_arm_home:
@ -273,8 +259,8 @@ script:
sequence: sequence:
- if: - if:
- condition: state - condition: state
entity_id: sensor.total_faults entity_id: binary_sensor.security_faults
state: '0' state: 'off'
then: then:
- service: alarm_control_panel.alarm_arm_home - service: alarm_control_panel.alarm_arm_home
target: target:
@ -299,8 +285,8 @@ script:
sequence: sequence:
- if: - if:
- condition: state - condition: state
entity_id: sensor.total_faults entity_id: binary_sensor.security_faults
state: '0' state: 'off'
then: then:
- service: alarm_control_panel.alarm_arm_away - service: alarm_control_panel.alarm_arm_away
target: target: