Last active
December 5, 2020 18:23
-
-
Save tteck/445e4fc2f7bddfe765d3eda90d15d8c2 to your computer and use it in GitHub Desktop.
A blueprint that turns off the selected switches (delayed if needed) when the alarm is armed. (Modified Frenck blueprint)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Turn off switches when the alarm is armed | |
description: A blueprint that turns off the selected switches when the alarm is armed. | |
domain: automation | |
input: | |
alarm: | |
name: Alarm Control Panel | |
description: Select a Alarm Control Panel | |
selector: | |
entity: | |
domain: alarm_control_panel | |
armed_away: | |
name: When the alarm is armed "Away" | |
default: true | |
selector: | |
boolean: {} | |
armed_home: | |
name: When the alarm is armed "Home" | |
default: true | |
selector: | |
boolean: {} | |
armed_night: | |
name: When the alarm is armed "Night" | |
default: true | |
selector: | |
boolean: {} | |
armed_custom_bypass: | |
name: When the alarm is armed "Custom Bypass" | |
default: false | |
selector: | |
boolean: {} | |
switches: | |
name: Switches | |
description: Select one or more switch to turn off | |
selector: | |
target: | |
entity: | |
domain: switch | |
switch_off_wait: | |
name: Wait time | |
description: Time to wait until the switch should be turned off. | |
default: 5 | |
selector: | |
number: | |
min: 0 | |
max: 3600 | |
unit_of_measurement: seconds | |
trigger: | |
- platform: state | |
entity_id: !input 'alarm' | |
to: | |
- armed_away | |
- armed_custom_bypass | |
- armed_home | |
- armed_night | |
variables: | |
on_armed_away: !input 'armed_away' | |
on_armed_custom_bypass: !input 'armed_custom_bypass' | |
on_armed_home: !input 'armed_home' | |
on_armed_night: !input 'armed_night' | |
condition: | |
- condition: or | |
conditions: | |
- condition: and | |
conditions: | |
- '{{ on_armed_away }}' | |
- condition: state | |
entity_id: !input 'alarm' | |
state: armed_away | |
- condition: and | |
conditions: | |
- '{{ on_armed_custom_bypass }}' | |
- condition: state | |
entity_id: !input 'alarm' | |
state: armed_custom_bypass | |
- condition: and | |
conditions: | |
- '{{ on_armed_home }}' | |
- condition: state | |
entity_id: !input 'alarm' | |
state: armed_home | |
- condition: and | |
conditions: | |
- '{{ on_armed_night }}' | |
- condition: state | |
entity_id: !input 'alarm' | |
state: armed_night | |
action: | |
- delay: !input switch_off_wait | |
- service: switch.turn_off | |
target: !input 'switches' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment