YET another take on an alarm system

My custom version of an alarm panel hoping to bring many new features at the request of fellow patrons.

Tested with HA Version 0.60.1

You can find the github here: https://github.com/gazoscalvertos/Hass-Custom-Alarm

Please contribute to this thread and submit your requests, suggestions, ideas and pitfalls!.

Features:

  • MQTT Integration
  • Google Assistant Integration
  • Clock display (Optional)
  • Weather Status (Optional) - NOTE: You must have dark sky weather component enabled specifically sensor.dark_sky_summary.
  • Digit code (0-9) entry on disarm
  • Customisable themed colours depending on alarm state, ie blue disarmed, orange pending, black armed. red triggered
  • List of open sensors with override option
  • Perimeter Mode (Optional) - Allows you to part activate the alarm in Home Day mode. I use this to only arm a particular set of sensors (doors) whilst I’m using all floors.
  • Countdown timer on ‘Pending’ state
  • Panic Mode

To be implemented:

  • Persistence support
  • Customisable Themes
  • Time Based themes (Dark at Night - Light during day)
  • Possibly a full black one with a Cylon style bar when activated?
  • Guest mode / reduced feature set
  • Anything anyone else can think of

Google Assistant Notes:

Follow this guide to setup google assistant if you haven’t already done so.

Then add 2x scripts into your scripts.yaml:

alarm_arm:
  sequence:
    service: alarm_control_panel.alarm_arm_away
    entity_id: alarm_control_panel.house
alarm_disarm:
  sequence:
    service: alarm_control_panel.alarm_disarm
    entity_id: alarm_control_panel.house
    data:
      code: 9999

Then create 2x shortcuts in the Google Home app

When I say “Arm house” > “Turn on alarm_arm”
When I say “Disarm house” > “Turn on alarm_disarm”

Based on @drytoastmans code here A different take on an alarm system

57 Likes

Wow! Just amazing! Will implemet this with a small touch screen in my entrance… Hioe therenwill he some designers here to pep up the interface …nice work.will test it and give a feedback

1 Like

don’t know if this possible to have the breached sensor name showing a bit cleaner, seems it’s not using the friendly name?

image

HI all… for me the two sensorgroups are not really clear. Which group does what exactly? Sorry for dumb question :stuck_out_tongue:

Hi, I can pick up the alarm in HA, however when clicking on the Alarm tab it’s blank, when using the developer tools I get the following error

Never mind I had to clear my cache :blush:

1 Like

i have a question. in the alarm.yaml what does the:

alarm: automation.alarm_triggered
warning: automation.alarm_warning

?
can i use the old:

alarm: switch.Alarm
warning: switch.Warning

?
ty

Hi gazoscalvertos, I’m a bit of a noob and probably missing something simple.

I use the below code for my automations.
Do you know what I’m missing?
The alarm works perfectly fine in Away mode, however when using Home mode. I do not get the notifications nor do I get the siren sound as I would in away mode. Maybe I’m missing something?

  • alias: Alarm Away
    hide_entity: true
    trigger:
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001ab1525
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001ab1e54
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001ab1f49
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001ab1f74
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001dbb7bb
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001dbd389
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001dbd4f3
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d0001656c09
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d0001656c85
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d0001656ebd
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d0001656ed7
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d00016dc085
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d0001a3e28e
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d0001a3e1a0
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d0001a3e2b4
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d0001a3e2b7
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d000165ff78
      from: ‘off’
      to: ‘on’
      condition:
      condition: state
      entity_id: alarm_control_panel.house
      state: armed_away
      action:
    • service: alarm_control_panel.alarm_trigger
      entity_id: alarm_control_panel.house
    • service: xiaomi_aqara.play_ringtone
      data:
      gw_mac: XXXXX
      ringtone_id: 10002
      ringtone_vol: 1
    • service: notify.iphones_all_notify
      data:
      message: ‘:warning: Alarm Triggered in Away Mode @ {{now().strftime("%Y:%m:%d - %H:%M:%S")}}’
      data:
      push:
      badge: 5

ALARM ARMED / Home Mode

  • alias: Alarm Home
    hide_entity: true
    trigger:
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001ab1525
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001ab1e54
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001ab1f49
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001ab1f74
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001dbb7bb
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001dbd389
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001dbd4f3
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d0001a3e2b7
      from: ‘off’
      to: ‘on’
    • platform: state
      entity_id: binary_sensor.motion_sensor_158d000165ff78
      from: ‘off’
      to: ‘on’
      condition:
      condition: state
      entity_id: alarm_control_panel.house
      state: armed_home
      action:
    • service: alarm_control_panel.alarm_trigger
      entity_id: alarm_control_panel.house
    • service: xiaomi_aqara.play_ringtone
      data:
      gw_mac: XXXXX
      ringtone_id: 10003
      ringtone_vol: 1
    • service: notify.iphones_all_notify
      data:
      message: ‘:warning: Alarm Triggered in Home Mode @ {{now().strftime("%Y:%m:%d - %H:%M:%S")}}’
      data:
      push:
      badge: 5

You can use the friendly name of the device, I’ll post some sample code this evening and upload to the github

1 Like

‘Delayed’ - Sensors in this group will trip the alarm but will not activate the siren/trigger state until after the ‘pending_time’ period unless the alarm is deactivated.

‘Immediate’ - Sensors in this group will activate the siren/trigger state immedilately when tripped.

‘Homemodeignore’ - Sensors in this group are ignored completely when the alarm is set in home mode. This allows you to 'partially ’ set the alarm.

Does this help?

It’s always advisable to clear the cache when implementing any code changes

Thanks @thundergreen I’m thinking of adding bootstrap library to make mobile/desktop design responsiveness easier

Yeah. Didn’t check the ui yet but as I’m very interested notbinky in technical aspects but also in design …it would be nice having a smart clean and easy GUI… (Wife acceptance factor) :wink:

Stupid question but I can’t see the GUI actually… I added all files and configured according to ky sensors but won’t see it not the frontend

Just saw that i forgot to add alarm_panel: !alarm.yaml. restarting… Will give a feedback

Again my fault not adding custom panel file…restarting has and reporting later

Without testing or checking the code I’m not sure if switch would work.

I would advise you to to setup the automations as you will need them in order to deactivate however the siren if you are using one.

Big issue… I’m missing the number 0 on the pad… My code includes those… Now I activated alarm and can’t disarm

Is it possible to somehow setup an automation for alarm pending like a sound or something?

Add alarm_control_panel.house to group.yaml then it will allow you to click and add the code using free text. I’ll implement the 0 in the next release.

For the alarm pending sound just setup an automation such as:

alias: ‘[Alarm] Pending’
trigger:

  • platform: state
    entity_id: alarm_control_panel.house
    to: ‘pending’
    action: [whatever sound device you want etc]

Now i have automation based on te state of alarm. I cant undertand what your code does.

This code takes care of the automation inclusion for the sensors providing you have set the groups up in alarm.yaml so there is no need to list each sensor in the automation.yaml.

All you need in automation.yaml is actions to trigger siren/notifications/sounds/etc and ones to disable siren.

I’ll upload a sample automation.yaml to the github tonight.

awesome work!

Quick question, for whatever reason under "All Sensors"I only get a few occupancy sensors, and not any Open/Close sensors, is that the intended behavior? (alarm state is disarmed if that matters)