🚨 Alarm System with ZHA Keypad support (KEPZB-110)

:rotating_light: Alarm System with ZHA Keypad support :rotating_light:

This blueprint offers a robust, flexible solution for those who want a fully integrated alarm system without the hassle of additional custom components. Whether you’re using it for home security, office monitoring, or any other application, this setup ensures that your alarm system is responsive and easy to manage.

Links:

:page_with_curl: My GitHub Repo
:blue_book: This blueprint

Version:

  • 2025-01-23: Make it possible to select your own Mobile Apps for notifications and implement an Always, Fire, Gas and Moisture mode.
  • 2025-01-21: Fixed bug where scripts weren’t running
  • 2025-01-20: Initial Version

Highlights:

  • No need for custom components, syncs seamlessly with ZHA-connected keypads.
  • Supports multiple user codes, including hexadecimal codes for RFID tags.
  • The logic to verify codes is built into the blueprint, so your alarm panel doesn’t need to support multiple codes.
  • Customizable notifications for Alarm Control Panel state changes – default notifications are already set, but you can tweak them to suit your preferences.
  • Option to show a live camera feed from any of your cameras inside the notification of state changes.
  • Customizable scripts for each alarm state change.

Requirements:

  • Home Assistant 2024.8.0 or later: as it is made with the newer syntax.
  • Alarm Panel: Manual Alarm Panel is enough to use this.
  • Physical Keypad: Implemented and tested with the frient Intelligent Keypad connected through ZHA.
  • Text Helpers: to be able to set multiple user codes. See below.

Getting Started:

  1. Download & Install the Blueprint:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

  1. Select the mandatory entities:


Follow the instructions in the Blueprint to make a basic setup. If you don’t have all the entities needed, see below how to create.

  1. Create a Text Helper, per code you want to use:

pattern: "^[0-9A-F+]+$"

You can create the Text Helper directly from the GUI of the blueprint or it’s also possible through YAML, see below.

  1. Setup the sensors, notifications, scripts and cameras you want to use per Alarm state:

  1. Setup the sensors, notifications, scripts and cameras you want to use for independent sensors:

YAML setup:

I find it easy to split my config into packages, so I can easily find different yaml entities related to specific device type. You can include the following in your Home Assistant config:

homeassistant:
  packages: !include_dir_named packages

Make sure to create packages folder in your /config/ directory.

I created a file called alarm.yaml in my packages folder with the following contents:

alarm_control_panel:
  - platform: manual
    name: Alarm
    code_arm_required: false
    armed_away:
      arming_time: 30
      delay_time: 20
    armed_home:
      arming_time: 0
      delay_time: 10
    armed_night:
      arming_time: 0
      delay_time: 20
input_text:
  alarm_code_keypad:
    name: Alarm Code Keypad
    icon: mdi:dialpad
    min: 1
    max: 16
    mode: password
    pattern: "^[0-9A-F+]+$"
  alarm_code_user_1:
    name: Alarm Code User 1
    icon: mdi:dialpad
    min: 1
    max: 16
    mode: password
    pattern: "^[0-9A-F+]+$"
  alarm_code_user_2:
    name: Alarm Code User 2
    icon: mdi:dialpad
    min: 1
    max: 16
    mode: password
    pattern: "^[0-9A-F+]+$"
  alarm_code_user_3:
    name: Alarm Code User 3
    icon: mdi:dialpad
    min: 1
    max: 16
    mode: password
    pattern: "^[0-9A-F+]+$"

This creates the manual alarm_control_panel, which this Blueprint uses as the controller of your Alarm system. You can select a different arming_time and delay_time per mode.

As I am using the Packages option, I can also put my Text Helpers in the same .yaml file to keep everything together.

After creating the Text Helpers in YAML or in the GUI you can set the pincodes yourself.

Open your Home Assistant instance and show your helper entities.
The content of the Text Helper is stored in your HA database, so is ‘safe’ in there. As an admin you can see the state of the Helper and see the stored code, but in your Automations the code is not visible.

You can also set the code with an Action on the Dev Tools page.

action: input_text.set_value
target:
  entity_id: input_text.alarm_code_user_1
data:
  value: "1234"

Open your Home Assistant instance and show your action developer tools.

Join the Community:

I can’t wait to see how you all use this Blueprint to enhance your smart homes. Please share your experiences, tips, and any creative uses you come up with. Together, we can make our homes smarter and more connected than ever!

Happy automating! :blush:

2 Likes

Hello,

Thanks for Sharing this kind of onfo.

Best Regards

First update today. Noticed the scripts weren’t running when the mode changes. The logic has changed and the Scripts now run at the same time. So if you select one or multiple scripts, they all start at the same time. So keep that in mind when selecting scripts.

Also moved the Actions I used to this blueprint as well. So they should now work for all users.

I have tried several blueprints and automations for keeping the frient keypad in sync with the home assistant alarm, both with zha and zigbee2mqtt, and this is the only one I’ve come across so far that seems to work flawless.

One thing that would be nice to have, is to be able to specify which devices to send the notifications to.

Thank you for the great work!

Thanks for the feedback.

Many of the other Blueprints rely on Alarmo to do the logic of the multiple codes, which I didn’t want to use. I am running my HA without any Custom Components so I can more easily do updates of HA without worrying about breaking changes.

Of course I’m still checking the breaking changes for the integrations I do use and if there are changes to the internal structure of the Automations/Scripts I will update the Blueprint accordingly, as I am using it myself.

I’ve been running like this with my own Automations for some time which I have now translated into this blueprint.

I have thought about implementing a target selection for the notifications, but for me personally it is fine to send the Notification to all Mobile Apps I have in my Home Assistant install. Will check how to implement this.

Something I am working on first is adding the possibility to have an ‘Always’ mode trigger, independent of Alarm state. For things like Smoke and Moisture alarms.

I have updated the blueprint.

It is now possible to select which device you want to send the notifications to.

Please keep in mind that due to this change, there is no default set anymore. As I was using notify.notify before which apparently can cause unexpected behavior.

Also implemented Always, Fire, Gas and Moisture modes for the Notification and Script system.

for me currently it does not work properly,
It tells me that the code used when disarming is incorrect…

Executed: January 29, 2025 at 00:30:11
Error: Invalid alarm code provided
Result:

params:
  domain: alarm_control_panel
  service: alarm_disarm
  service_data:
    code:
      - '1234'
    entity_id:
      - alarm_control_panel.home_alarm
  target:
    entity_id:
      - alarm_control_panel.home_alarm
running_script: false

Are you using a Physical Keypad?

The virtual Keypad linked to the main alarm control panel has no code, only when interacting with the secondary (physical keypad), you can use multiple codes that are set with the Text Helpers.

There is no way to link multiple codes to the Manual Alarm Control panel directly, this is a limitation of HA itself. The blueprint handles the inputs from the Physical keypad to match the codes.

The Physical Keypad does need to have a code, which you set in the ZHA integration settings and use a text helper to store that code for the Blueprint. The ZHA integration itself also only supports one code, which I set to an 8 digit code myself, so it is not used by normal users, just for the sync between alarms.

If needed I can change the blueprint so the main alarm control panel can have a single master code like with the physical keypad. I am not using it like that as I don’t want to put in codes to change the alarm modes when I have access to my HA app and control the alarm through HA directly.

After a bit of tweaks, I got it working.

I had to disable the password on the virtual keypad, the manual configuration.yaml one.
After I had done that, it works like a charm.

but yes,
I am also using the kepzb-110

Its a shame that there isn’t such a setting as;
when arming > no code is needed > when changing armed mode> code is needed.
But that is something a firmware update (which I dont expect from the devs) could update.

I must say, other than that, the blueprint works like a charm

Good to hear it works for you now. I am not using a code on my Manual Alarm Control Panel. As I like to be able to change the modes easily when I have access to my HA Dashboard.

Anyone with access to my HA Dashboard has protected access.

It is sadly a limitation of how the Manual Alarm Control Panel works, it’s either one code or no code for all states. Same with the implementation of the ZHA Alarm Control Panel, which is even more limited.

The ZHA Alarm Control Panel doesn’t even support the arming/pending states. So if you would use the ZHA Alarm Control Panel directly it would directly go to armed when armed and directly sound the alarm when you would trigger a sensor when entering your home.

The KEPZB-110 supports all the states and more features, but sadly those are not implemented into ZHA currently. So my blueprint is using the ‘triggered’ state of the Keypad when it is in arming/pending and triggered state.

Which is why I made this Blueprint :slight_smile:, to fix those states and other things that are not present in the native implementation itself.

In an ideal implementation, you would have multiple code support in ZHA directly and all the states the Control Panel supports natively. All the GitHub issues about this have been closed due to inactivity in the past years.