Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jhenkens/851c0d88b3ed8fecd8df9f30f932e127 to your computer and use it in GitHub Desktop.
Save jhenkens/851c0d88b3ed8fecd8df9f30f932e127 to your computer and use it in GitHub Desktop.
Alarm Chime for Home Assistant Envisalink
# NOTE
# You will need to change `alarm_control_panel.home_alarm` and `sensor.home_alarm_keypad` to match the entity names you have.
script:
send_alarm_command_with_pin:
fields:
command_after_pin:
description: "The command to send after the pin"
variables:
alarm_code: !secret alarm_code
sequence:
- service: envisalink_new.alarm_keypress
data:
entity_id: alarm_control_panel.home_alarm
keypress: "{{ alarm_code }}{{ command_after_pin }}"
- delay:
milliseconds: "1000"
toggle_alarm_chime:
sequence:
- service: script.send_alarm_command_with_pin
data:
command_after_pin: "9"
turn_on_alarm_chime:
sequence:
- condition: state
entity_id: sensor.home_alarm_keypad
attribute: chime
state: off
- service: script.toggle_alarm_chime
turn_off_alarm_chime:
sequence:
- condition: state
entity_id: sensor.home_alarm_keypad
attribute: chime
state: on
- service: script.toggle_alarm_chime
switch:
- platform: template
switches:
alarm_chime:
friendly_name: "Alarm Chime"
value_template: "{{ state_attr('sensor.home_alarm_keypad', 'chime') }}"
turn_on:
service: script.turn_on_alarm_chime
turn_off:
service: script.turn_off_alarm_chime
homeassistant:
packages: !include_dir_named packages
alarm_code: 1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment