Skip to content

Commit

Permalink
Update behavior of tilt sensor; add panic button
Browse files Browse the repository at this point in the history
  • Loading branch information
heythisisnate committed Mar 3, 2025
1 parent ccbcf65 commit 1dfe1c9
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions examples/alarm-panel-pro-local-alarm-keyswitch-arming.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ binary_sensor:
name: Pedestal Door
device_class: door

# Tilt sensor
# Always trigger the alarm when tilted, even if disarmed
- id: !extend zone8
name: Tilt
device_class: tamper
Expand All @@ -79,28 +81,6 @@ binary_sensor:
lambda: 'return x;'
then:
- alarm_control_panel.triggered: acp1
else:
- alarm_control_panel.disarm: acp1


# Zone 7 is connected to a relay which arms and disarms the alarm system.
# ON/open = disarmed
# OFF/closed = armed
- id: !extend zone7
internal: true
on_state:
then:
- if:
condition:
lambda: 'return x;'
then:
- alarm_control_panel.disarm: acp1
else:
- if:
condition:
binary_sensor.is_off: zone1
then:
- alarm_control_panel.arm_away: acp1

# Computed state of the electronically controlled latch which is
# unlocked when the signal is high. Upon unlocking, the alarm system
Expand All @@ -123,7 +103,7 @@ binary_sensor:
# arm based on the state of both doors and the electronically
# controlled latch
# ON means problem; OFF means ready
# When the state changes to ready, arm the alarm
# When the state changes to ready, reset and arm the alarm
- id: ready
name: Ready
device_class: problem
Expand All @@ -149,12 +129,20 @@ sensor:
update_interval: 1s
attenuation: auto
entity_category: diagnostic
# internal: true
internal: true

switch:
- id: !extend alarm1
name: Siren

# Panic button - instantly trigger the alarm, regardless of state
button:
- id: panic_button
platform: template
name: Panic Button
on_press:
- alarm_control_panel.triggered: acp1

script:
- id: trigger_timeout
then:
Expand Down

0 comments on commit 1dfe1c9

Please sign in to comment.