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

:rotating_light: Alarm System with Z2M 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

:closed_book: ZHA version
:orange_book: Z2M version

Version:

  • 2025.04.1: Add Emergency mode for Keypad
  • 2025.04.0: Change variables to be unique per arm_action
  • 2025.03.2: Add audio announcements functionality
  • 2025.03.1: Fix: Scripts for Arming or Pending states do not fire
  • 2025.03.0: Initial version for Z2M with the same features as my other Blueprint.

Highlights:

  • No need for custom components, syncs seamlessly with Z2M-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 text notifications for Alarm Control Panel state changes – default notifications are already set, but you can tweak them to suit your preferences.
  • Customizable audio announcements for Alarm Control Panel state changes, the messages follow the text notifications.
  • 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 Z2M.
  • 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_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

I have released a new version today with added functionality! Works great for me with my USB connected speaker to my Home Assistant OS device. You could use any Media Player available to your Home Assistant.

New update today, to comply with the changes in HA 2025.4.0 .

Hi, your blueprint is awesome, great and inspiring work! Thank you so much!
A quick question from me: is it possible to implement the SOS button keypress in the given choices?
Much obliged!

I just checked my keypad and didn’t even notice there was a SOS button on it after using it for over a year :rofl: .

Just checked the response how to use it. By double pressing the SOS button it triggers an action called ‘emergency’. So I can implement this in the Blueprint when I have time.

1 Like

Thank you in advance for your time!

New update today. I have implemented the SOS button on the Keypad. Double pressing doesn’t always respond the same way. So it is best to long press the SOS button to trigger the Emergency mode of the Keypad.

2 Likes

You are the best! You blueprint rocks, covering all the possible scenarios! Thank you so much for this…
I’ll give it a try right away!

Best wishes

1 Like

Thank you for your job @danieldeni , it was amazing

I have just a question on your blueprint.
It seems the arm button on the Keypad (with the lock icon) doesn’t trigger the automation.
It seems that only user code enter via the keypad trigger the automation.
Did I understand correctly?

Thks again for your work

it seems to the following condition is always false when I arm from the Keypad

      - alias: Alarm Keypad to Alarm Main sync
        conditions:
          - condition: trigger
            id: alarm_keypad
          - condition: template
            value_template: "{{ trigger.payload_json.action_code in alarm_code_user_state }}"

I add a card to set a value in input text alarm_code_main for example.
Have you any idea ?

And is it possible to know which entity triggers the alarm ?
Thks a lot

Yes, it will only arm if you input the code. Otherwise the result is empty and it won’t run any automations as the state doesn’t change.

It is currently not supported to arm without a code on the physical keypad, as it would also be able to disarm without a code then, which you don’t want on the physical keypad.

The virtual alarm_control_panel inside Home Assistant can be armed/disarmed without a code.

Ok I will try to adapt that to arm without code from keypad
Thks for your reply

Would be great to add the user (determined by the code from the input_text) who triggered the automation to the notification. Can you add this?

I’ve tried to implement it, but it’s not as easy as I thought. The variable for the code is not used in a way that it can be used for the notification as the notification is not triggered by the input of the code itself.

I would need to rework the logic of the Blueprint to be able to implement the Names of the entries. Not sure when I would have the time for it as it’s quite a big rework of the logic to be able to achieve that.

I have found that the camera does in fact not share a snapshot into the notifications (at least not within android),

I made a small test yaml to actually get a snapshot to my phone, this seems to be working, maybe something in the config is missing, I don’t actually see the automation steps for the snapshot / image.

alias: TEST - Camera Snapshot
description: ""
triggers: []
conditions: []
actions:
  - action: camera.snapshot
    metadata: {}
    data:
      filename: /media/NetworkShare_SMB_Media/camera/snapshot.jpg
    target:
      device_id: df2dc680dd01d6462895ece6c13e331a
  - action: notify.mobile_app_sm_s928b
    metadata: {}
    data:
      data:
        image: /media/local/NetworkShare_SMB_Media/camera/snapshot.jpg
        entity_id: camera.camera_bedroom
        actions:
          - action: URI
            title: Open Camera
            uri: /dashboard-home/cameras
      message: someone is in your room!
      title: Movement!
mode: single

The blueprint does not do that no. It was only supported in iOS to send a camera feed directly into the notification.

Which I only found out when switching back to Android. As I didn’t find it useful to have just a screenshot I haven’t implemented that.

For now you could make a script that does that and prompt it where you need the snapshot.

ah gotcha,

I wasn’t aware of it NOT being able in android before,
I thought I had just missed it.

Still using the blueprint daily and it works like an absolute charm,
I’ll build it as a script then :slight_smile:

Hi @danieldeni

I noticed that when I try to disable the alarm, if the entity has a code defined, the blueprint fails to send the entered code correctly.

From what I understand, the blueprint tries to send the list of codes defined in the configuration, but the ‘alarm_control_panel.alarm_disarm’ action only accepts a single code. Isn’t there an error?

Hi, which entity ‘has a code defined’ in your example? Do you mean the Manual Alarm Control Panel in HA you have created in your environment?

I am using it without a code within HA itself as it’s not possible to use multiple codes with the native Manual Alarm Control Panel, only with something like Alarmo your Alarm Control Panel itself can accept multiple codes.