2018-01-02 00:00:45 +00:00
|
|
|
######################################################################
|
|
|
|
## Shut it all down. No one is here
|
|
|
|
######################################################################
|
|
|
|
|
2022-12-19 23:44:47 +00:00
|
|
|
# Define an alias for this automation
|
2018-01-02 00:00:45 +00:00
|
|
|
- alias: 'Away Mode'
|
2022-12-19 23:44:47 +00:00
|
|
|
# Give the automation a unique ID
|
2020-07-20 18:33:03 +00:00
|
|
|
id: 712e845a-9d72-4993-b8af-890b167c807b
|
2022-12-19 23:44:47 +00:00
|
|
|
# Set the mode to "single"
|
2020-07-29 23:54:10 +00:00
|
|
|
mode: single
|
2022-12-19 23:44:47 +00:00
|
|
|
# Set the trigger for the automation
|
2018-01-02 00:00:45 +00:00
|
|
|
trigger:
|
2022-12-19 23:44:47 +00:00
|
|
|
# The automation will be triggered when the state of the "binary_sensor.downstairs_nest_away" entity changes to "on"
|
2018-01-02 00:00:45 +00:00
|
|
|
- platform: state
|
2020-06-21 17:43:35 +00:00
|
|
|
entity_id: binary_sensor.downstairs_nest_away
|
2020-08-04 17:29:25 +00:00
|
|
|
to: 'on'
|
2022-12-19 23:44:47 +00:00
|
|
|
# The automation will also be triggered when the state of the "group.family" entity changes to "not_home"
|
2018-01-02 00:00:45 +00:00
|
|
|
- platform: state
|
|
|
|
entity_id: group.family
|
|
|
|
to: 'not_home'
|
2020-02-15 21:22:42 +00:00
|
|
|
|
2022-12-19 23:44:47 +00:00
|
|
|
# Set the conditions for the automation to run
|
2018-01-02 00:00:45 +00:00
|
|
|
condition:
|
2022-12-19 23:44:47 +00:00
|
|
|
# The automation will only run if the state of the "group.family" entity is "not_home"
|
2018-01-02 00:00:45 +00:00
|
|
|
- condition: state
|
|
|
|
entity_id: group.family
|
|
|
|
state: 'not_home'
|
2022-12-19 23:44:47 +00:00
|
|
|
# The automation will also only run if the state of the "input_boolean.guest_mode" entity is "off"
|
2018-01-02 00:00:45 +00:00
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.guest_mode
|
|
|
|
state: 'off'
|
|
|
|
|
2022-12-19 23:44:47 +00:00
|
|
|
# Set the actions to be performed by the automation
|
2018-01-02 00:00:45 +00:00
|
|
|
action:
|
2022-12-19 23:44:47 +00:00
|
|
|
# Run the "script.interior_off" service
|
2018-01-02 00:00:45 +00:00
|
|
|
- service: script.interior_off
|
2020-07-29 23:54:10 +00:00
|
|
|
|
2022-12-19 23:44:47 +00:00
|
|
|
# Turn off the "switch.back_landscaping" switch
|
2018-01-02 00:00:45 +00:00
|
|
|
- service: switch.turn_off
|
|
|
|
entity_id: switch.back_landscaping
|
2020-07-29 23:54:10 +00:00
|
|
|
|
2022-12-19 23:44:47 +00:00
|
|
|
# Arm the "alarm_control_panel.alexa_guard" alarm unless the "input_boolean.guest_mode" entity is "on"
|
2020-08-18 02:17:33 +00:00
|
|
|
- condition: template
|
|
|
|
value_template: >
|
|
|
|
{{ states.input_boolean.guest_mode.state != "on" }}
|
2020-07-29 23:54:10 +00:00
|
|
|
- service: alarm_control_panel.alarm_arm_away
|
|
|
|
entity_id: alarm_control_panel.alexa_guard
|