YET another take on an alarm system

No it’s always been a custom panel

Here is my Alarm.yaml:

name: House

code: !secret alarm_code 
panic_code: !secret panic_code  

pending_time: 60
trigger_time: 45

alarm: automations.alarm_triggered
warning: automations.alarm_warning

##[OPTIONAL SETTINGS] 
clock: True  #[Optional] - False by default. True enables a clock in the center of the status bar
perimeter_mode: True #[Optional] - False by default. True enables perimeter mode, this could be known as 'Day Mode' i.e. only arm the doors whilst there is someone using all floors
weather: True #[Optional] - False by Default. Allows a weather summary to be displayed on the status bar. Dark Sky weather component must be enabled with the name sensor.dark_sky_summary
persistence: True #[OPTIONAL] False by Default. Allows this custom component to save the state of the alarm to file then reinstate it in the event of power loss.
hide_passcode: True #[OPTIONAL] - True by default. This is a security feature when enabled hides the passcode while entering disarm code.
hide_sidebar: True #[OPTIONAL] - False by default. This is a security feature when enabled hides the HA sidebar when the alarm is armed. The sidebar re-appears when the alarm is disarmed.
hide_sensor_groups: True 
hide_custom_panel: True 

##[PASSCODE RELATED]
passcode_attempts: 3 #[Optional] Disabled if commented out. When a value equal or greater than 0 is set, the system will only allow the set amount of password attempts before timing out
passcode_attempts_timeout: 30 #[Optional] Default 30 seconds. When set with the password attempts option the panel will timeout for the amount of seconds set if the password is entered incorrectly as per the password_attempts option. The system will then reset the allowed password attempts

##[MQTT RELATED]
mqtt: True #[OPTIONAL] - False by default. Settings this to True will enable MQTT Mode. Uncomment options below to use See the README for guidance.
override_code: True #[OPTIONAL] False by default. if true allows MQTT commands to disarm the alarm without a valid code.
state_topic: 'home/alarm' #[OPTIONAL] The MQTT topic HA will publish state updates to.
command_topic: 'home/alarm/set' #[OPTIONAL] The MQTT topic HA will subscribe to, to receive commands from a remote device to change the alarm state.
qos: 0 #[OPTIONAL] The maximum QoS level for subscribing and publishing to MQTT messages. Default is 0.
#payload_disarm: "DISARM" #[OPTIONAL] The payload to disarm this Alarm Panel. Default is “DISARM”.
payload_arm_home: "ARM_HOME" #[OPTIONAL] The payload to set armed-home mode on this Alarm Panel. Default is “ARM_HOME”.
payload_arm_away: "ARM_AWAY" #[OPTIONAL] The payload to set armed-away mode on this Alarm Panel. Default is “ARM_AWAY”.
payload_arm_night: "ARM_NIGHT" #[OPTIONAL] The payload to set armed-night mode on this Alarm Panel. Default is “ARM_NIGHT”.

############### COLOURS ###########  Use any HTML format
warning_colour: 'orange'
pending_colour: 'orange'
disarmed_colour: '#03A9F4'
armed_home_colour: 'black'
armed_away_colour: 'black'
triggered_colour: 'red'

############# SENSOR GROUPS ########################
##Sensors in this group tigger the alarm immediately
immediate:
  - binary_sensor.basement_main_window_sensor
  - binary_sensor.basement_outside_door_sensor
  - binary_sensor.computer_room_north_window_computer_room_window
  - binary_sensor.laundry_room_window_doorwindow_sensor

##Sensors in this group start the clock (pending_time) when tripped before the alarm is activated in 'Away' mode
delayed:
  - binary_sensor.front_door_sensor
  - binary_sensor.garage_outside_door_sensor

##Same as notathome but hopefully the title is more self explanatory. Can still use notathome for backwards compatibility
##Note sensors can exist in more than one group notice top_floor appears in two groups
homemodeignore:

##Use this group to automatically override the warning message on open sensors when setting 'away' mode. (I use this as I have a motion sensor at the front door)
override:


##This group is special and only effects 'perimeter mode'. If perimeter_mode is enabled then any sensor in this group will trigger the alarm immediately if arm perimeter is set. There is no delayed group for this mode (unless requested as a feature of course!)
perimeter:
  - binary_sensor.basement_main_window_sensor
  - binary_sensor.basement_outside_door_sensor
  - binary_sensor.computer_room_north_window_computer_room_window
  - binary_sensor.laundry_room_window_doorwindow_sensor

##[OPTIONAL] - CUSTOM SENSOR STATUSES - These settings allow devices which are not natively supported by this panel to be used. 
##This is to be used when the state of the device is not recognised by the panel. Examples are provided below 
#custom_supported_statuses_on:
#  - 'running' #EXAMPLE
#  - flipped #EXAMPLE
#custom_supported_statuses_off:
#  - 'not_running' #EXAMPLE
#  - unflipped   #EXAMPLE```

Here is the error message:
```Testing configuration at /home/homeassistant/.homeassistant
2018-02-19 13:27:31 INFO (MainThread) [homeassistant.setup] Setting up recorder
2018-02-19 13:27:31 INFO (MainThread) [homeassistant.setup] Setting up mqtt
2018-02-19 13:27:31 INFO (MainThread) [homeassistant.setup] Setting up http
2018-02-19 13:27:31 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 0.0 seconds.
2018-02-19 13:27:31 INFO (MainThread) [homeassistant.setup] Setup of domain mqtt took 0.0 seconds.
2018-02-19 13:27:31 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
2018-02-19 13:27:31 INFO (MainThread) [homeassistant.setup] Setting up history
2018-02-19 13:27:31 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up api
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up system_log
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up frontend
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up zwave
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up google
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up group
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up sensor
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up sun
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up rest_command
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up notify
2018-02-19 13:27:32 ERROR (MainThread) [homeassistant.config] Invalid config for [alarm_control_panel.bwalarm]: Entity IDs can not be None for dictionary value @ data['homemodeignore']. Got None
Entity IDs can not be None for dictionary value @ data['override']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/alarm_control_panel.bwalarm/
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up alarm_control_panel
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up updater
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up hue
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up ffmpeg
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up input_select
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up discovery
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up input_boolean
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up lutron_caseta_pro
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up map
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up zone
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain zwave took 0.2 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain google took 0.2 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain group took 0.2 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain rest_command took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain notify took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain alarm_control_panel took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain hue took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain ffmpeg took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain input_select took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain discovery took 0.1 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain input_boolean took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain lutron_caseta_pro took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain map took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up camera
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up panel_custom
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up media_player
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up logbook
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up config
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up panel_iframe
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up conversation
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up tts
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up google_assistant
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up script
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up cover
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up remote
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up automation
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain camera took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain panel_custom took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain media_player took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain panel_iframe took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain google_assistant took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain cover took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain remote took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setting up device_tracker
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.0 seconds.
2018-02-19 13:27:32 INFO (MainThread) [homeassistant.setup] Setup of domain device_tracker took 0.0 seconds.
Failed config
  alarm_control_panel.bwalarm: 
    platform: bwalarm
    alarm: automations.alarm_triggered
    armed_away_colour: black
    armed_home_colour: black
    clock: True
    code: 8891
    command_topic: home/alarm/set
    delayed: [source /home/homeassistant/.homeassistant/alarm.yaml:55]
      - binary_sensor.front_door_sensor
      - binary_sensor.garage_outside_door_sensor
    disarmed_colour: #03A9F4
    hide_custom_panel: True
    hide_passcode: True
    hide_sensor_groups: True
    hide_sidebar: True
    homemodeignore: None
    immediate: [source /home/homeassistant/.homeassistant/alarm.yaml:48]
      - binary_sensor.basement_main_window_sensor
      - binary_sensor.basement_outside_door_sensor
      - binary_sensor.computer_room_north_window_computer_room_window
      - binary_sensor.laundry_room_window_doorwindow_sensor
    mqtt: True
    name: House
    override: None
    override_code: True
    panic_code: 0509
    passcode_attempts: 3
    passcode_attempts_timeout: 30
    payload_arm_away: ARM_AWAY
    payload_arm_home: ARM_HOME
    payload_arm_night: ARM_NIGHT
    pending_colour: orange
    pending_time: 60
    perimeter: [source /home/homeassistant/.homeassistant/alarm.yaml:68]
      - binary_sensor.basement_main_window_sensor
      - binary_sensor.basement_outside_door_sensor
      - binary_sensor.computer_room_north_window_computer_room_window
      - binary_sensor.laundry_room_window_doorwindow_sensor
    perimeter_mode: True
    persistence: True
    qos: 0
    state_topic: home/alarm
    trigger_time: 45
    triggered_colour: red
    warning: automations.alarm_warning
    warning_colour: orange
    weather: True

Successful config (partial)
  alarm_control_panel.bwalarm:```
1 Like

What happens if you make and put a dummy sensor in both of the following

homemodeignore: 
  - sensor.your_dummy_sensor

override:
  - sensor.your_dummy_sensor

I had to comment out empty sensor groups in the config. Otherwise the alarm panel would not show.

1 Like

Doh. Yeah that would be simpler.

Anyone manged to merge the HA SwitchPlate project (HA SwitchPlate - DIY LCD Touchscreen wall switch replacement) with the alarm? The switch pla

I would like to use the SwitchPlate to interract with the alarm system. Is it possible for the alarm system to receive the passcode via MQTT? Or what is the best way to set it up? Anyone managed set this up and can share their code?

@Freland I like this project!

I may build one oneday.

There are probably a couple of methods to get this working:

  1. Use custom MQTT to trigger an automation in HA to arm/disarm the alarm
  2. modify the Nextion code to send an MQTT command to topic: home/alarm/set ‘DISARM 8654’

This actually did work but yes I did not think of commenting out the empty group either. Thanks for the help. Now I am wondering if a cross group functionality was thought of to reduce false alarms. For example if you have a motion sensor near a door the alarm would not trigger unless both are activated.

Works prefectly. Thanks Gaz.

Hi,
I am not able to display the clock. I have clock: True in alarm.yaml and I have rebooted several times also changing the value between restarts.
Any hint?

You also need the following in your configuration.yaml

sensor:
  - platform: time_date
    display_options:
      - 'time'

That did it.
Thanks a lot!

Hi,
Is possible to set a pending time also for the home mode?

I cannot seem to get this alarm system working. I saved all the files in my config folder, saved the two line items in my configuration.yaml. But when I restart it noting comes up, HA does not start, I waited a good 30 minutes.

I am running HassIO 0.64.0. It seems it cannot load the bwalarm.py custom_component. Any idea what I need to do? I loaded a simple alarm and it seems to work fine…

This works

alarm_control_panel:
  - platform: manual
    name: Home Alarm
    code: 1234
    pending_time: 30
    delay_time: 20
    trigger_time: 4
    disarmed:
      trigger_time: 0
    armed_home:
      pending_time: 0
      delay_time: 0

This starts, but gives an error

alarm_control_panel:
  - platform: bwalarm
    name: Home Alarm
    code: 1234
    pending_time: 30
    delay_time: 20
    trigger_time: 4
    disarmed:
      trigger_time: 0
    armed_home:
      pending_time: 0
      delay_time: 0

You only need to put the two lines in configuration.yaml. They point to the files where this new alarm component is configured.
Do not write that alarm_control_panel definition.
And then check the logs for errors.

yes, i put the two lines in and hassio never started back up, so i could not check the log.
i then tried the manual alarm to see if it would work and did.

Just one suggestion: move the code readout somewhere else. The buttons shift down when the first character appears, causing misclicks.

Or, have the “line” be full width before you enter characters.

2 Likes

I have set up this panel and it works as expected. However, I have a request. May be this could already be done, but I do not know how.
I have defined the home mode by ignoring the motion sensors I have at the rooms in my house. I have a tablet in my kitchen where I arm and disarm the alarm. In the kitchen there is a motion sensor and another in a corridor I need to pass to get to the rooms. Those sensors are in the immediate group.
So, after I arm the alarm in home mode and go to the rooms, it triggers immediately.
I think it should have a pending time also for the home mode, as the official alarm_panel has.
Any way to do this?

Thanks in advance.

The home mode is supposed to ignore the motion sensors inside the house. That is why it is called “home mode”.
The window sensors are active but not the motion sensors inside the house. It makes no sense to trigger the alarm when you wake up in the middle of the night when you really need to pee. Can you imagine having to disarm the alarm every time you wake up at 3 am?

I understand your reasoning. But in that case, why the official alarm component has a pending time also for the home mode? why I have a comercial alarm system I pretend to replace with HA, that when armed with “home mode” enabled, let me pee while my first floor is kept completly motion awarded? what is the use of “night mode”? And with this new component, “perimeter mode”? can you imagine a house with more than a floor?
Our needs are not always the same. And flexibility is always a gain, I think.