Zigbee2MQTT - Sync Keypad and Alarm Control Panel States

Yes, you are right. I updated the blueprint accordingly.

1 Like

Has anyone used the Linkind ZS130000078 keypad with rechargeable 3.7V rechargeable batteries type 16340 and can tell, if they work as replacement for the CR123A batteries?

Hello
Thank you for this blueprint. Is there a way to use different pin codes?
I use a keypad with a rfid sensor. Each rfid tag returns a different pin code through zigbee2mqtt (for example +2FA9ED04). Each member of the family has a different tag and of course a different pin code. I can add each of them in alarmo but the blueprint only works with the main pin code.
Iā€™ve looked a little bit at your blueprint but there is only one ā€œpin:ā€ option and of course I canā€™t duplicate it. Iā€™ve tried to put several pin codes separated with a, or a ; but it wonā€™t work.
Thanks

1 Like

Thanks - unfortunately I will have to wait till next week to test it out.

Thanks for the command Pimseb, Iā€™m also looking for this option.

In principle, it is possible to adapt the blueprint in this scenario. For this, several PIN variables would have to be introduced under different names. In the queries you can then check if one of the PINs is correct. For example:

trigger.payload_json.action_code == pin_var or trigger.payload_json.action_code == second_pin_var

I set the ā€œAction Panic, An action to be performed when the panic / SOS button of the keypad is pressed.ā€ to ā€œTrigger Alarmoā€ but nothing happens. I can set HOME, AWAY, arm and disarmā€¦ Only a yellow light blinks on my frient KEPZB-110 keypad?

Would this be possible no matter what keypad is used? The way I read the Develco KEYZB-110 docs, it seems that it validates the PIN-code on the device. I believe others does as well - they expect to be armed with a PIN code, and disarmed later with the same PIN code. i Is it possible to set a list of different PIN codes to the different alarm panels? I assume a work around would be to disarm the panel from HA using a set code, and have separate checking of valid PINs.

Have anyone tested if the different alarm panels can be armed without a PIN code? I donā€™t want to have to enter a PIN to arm the alarm using the keypad.

If the PIN code is evaluated directly on the device, then you can only use this PIN. But I donā€™t know if there are devices that do so. If they do, you would have to set the PIN on the device itself first, which is not the case with the keypads I know.

Ah, Ok, then I probably have misread the develco keypad user manual. Iā€™ll give it a shot!

I have added the entry_delay to the blueprint and it works really well with my keypad (the Xfinity XHK1-UE, Universal Electronics Inc XHK1-UE control via MQTT | Zigbee2MQTT)

blueprint:
  name: PIN-Keypads for Zigbee2MQTT - with entry delay
  description: This Blueprint allows the synchronisation of an alarm control panel
    with a Zigbee2MQTT keypad. This means that the status of the alarm control panel
    is transmitted to the keypad and vice versa.
  domain: automation
  input:
    z2m_keypad_path:
      name: MQTT State Topic of your Zigbee2MQTT Keypad
      description: 'The State Topic is composed of your Zigbee2MQTT base_topic (see
        your Z2M Addon Configuration) and the Friendly Name of your keypad in Z2M.
        Example: zigbee2mqtt/Keypad'
    z2m_keypad_path_set:
      name: MQTT Set Topic of your Zigbee2MQTT Keypad
      description: 'This is the same as your State Topic, with the addition of /set.
        Example: zigbee2mqtt/Keypad/set'
    pin:
      name: Pincode
      description: 'The valid pin code to be accepted as correct by your alarm system.
        Example: 1234'
    control_panel:
      name: Control Panel
      description: 'An alarm control panel. Example: https://www.home-assistant.io/integrations/manual'
      default: []
      selector:
        entity:
          domain: alarm_control_panel
    action_arming:
      name: Action Arming
      description: An action to be performed when the alarm panel changes to the arming
        state.
      default: []
      selector:
        action: {}
    action_armed_home:
      name: Action Armed Home
      description: An action to be performed when the alarm panel changes to the armed
        home state.
      default: []
      selector:
        action: {}
    action_armed_away:
      name: Action Armed Away
      description: An action to be performed when the alarm panel changes to the armed
        away state.
      default: []
      selector:
        action: {}
    action_armed_night:
      name: Action Armed Night
      description: An action to be performed when the alarm panel changes to the armed
        night state.
      default: []
      selector:
        action: {}
    action_disarmed:
      name: Action Disarmed
      description: An action to be performed when the alarm panel changes to the disarmed
        state.
      default: []
      selector:
        action: {}
    action_pending:
      name: Action Pending
      description: An action to be performed when the alarm panel changes to the pending
        state.
      default: []
      selector:
        action: {}
    action_panic:
      name: Action Panic
      description: An action to be performed when the panic / SOS button of the keypad
        is pressed.
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/zigbee2mqtt-sync-keypad-and-with-alarm-control-panel-states/345311
variables:
  pin_var: !input 'pin'
trigger:

- platform: state
  entity_id: !input 'control_panel'
  to: arming
  id: panel_arming
- platform: state
  entity_id: !input 'control_panel'
  to: disarmed
  id: panel_disarmed
- platform: state
  entity_id: !input 'control_panel'
  to: armed_home
  id: panel_armed_home
- platform: state
  entity_id: !input 'control_panel'
  to: armed_away
  id: panel_armed_away
- platform: state
  entity_id: !input 'control_panel'
  to: armed_night
  id: panel_armed_night
- platform: state
  entity_id: !input 'control_panel'
  to: pending
  id: panel_pending
- platform: mqtt
  topic: !input 'z2m_keypad_path'
  id: keypad_mqtt
condition: []
action:
- choose:
  - conditions:
    - condition: trigger
      id: panel_arming
    sequence:
    - choose:
      - conditions:
        - condition: state
          entity_id: !input 'control_panel'
          state: armed_home
          attribute: next_state
        sequence:
        - service: mqtt.publish
          data:
            topic: !input 'z2m_keypad_path_set'
            payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_day_zones\"\n  }\n}"
      - conditions:
        - condition: state
          entity_id: !input 'control_panel'
          state: armed_night
          attribute: next_state
        sequence:
        - service: mqtt.publish
          data:
            topic: !input 'z2m_keypad_path_set'
            payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_night_zones\"\n  }\n}"
      - conditions:
        - condition: state
          entity_id: !input 'control_panel'
          state: armed_away
          attribute: next_state
        sequence:
        - service: mqtt.publish
          data:
            topic: !input 'z2m_keypad_path_set'
            payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"exit_delay\"\n  }\n}"

      default: []
    - choose:
      default: !input 'action_arming'
  - conditions:
    - condition: trigger
      id: panel_armed_away
    sequence:
    - service: mqtt.publish
      data:
        topic: !input 'z2m_keypad_path_set'
        payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_all_zones\"\n  }\n}"
    - choose:
      default: !input 'action_armed_away'
  - conditions:
    - condition: trigger
      id: panel_disarmed
    sequence:
    - service: mqtt.publish
      data:
        topic: !input 'z2m_keypad_path_set'
        payload: "{\n \"arm_mode\": \n  {\n    \"mode\": \"disarm\"\n  }\n}"
    - choose:
      default: !input 'action_disarmed'
  - conditions:
    - condition: trigger
      id: panel_armed_home
    sequence:
    - service: mqtt.publish
      data:
        topic: !input 'z2m_keypad_path_set'
        payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_day_zones\"\n  }\n}"
    - choose:
      default: !input 'action_armed_home'
  - conditions:
    - condition: trigger
      id: panel_armed_night
    sequence:
    - service: mqtt.publish
      data:
        topic: !input 'z2m_keypad_path_set'
        payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_night_zones\"\n  }\n}"
    - choose:
      default: !input 'action_armed_night'
  - conditions:
    - condition: trigger
      id: panel_pending
    sequence:
    - service: mqtt.publish
      data:
        topic: !input 'z2m_keypad_path_set'
        payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"entry_delay\"\n  }\n}"
    - choose:
      default: !input 'action_pending'
  - conditions:
    - condition: trigger
      id: keypad_mqtt
    sequence:
    - choose:
      - conditions:
        - condition: template
          value_template: '{{ trigger.payload_json.action_transaction != null and
            trigger.payload_json.action_code == pin_var }}'
        sequence:
        - service: mqtt.publish
          data:
            topic: !input 'z2m_keypad_path_set'
            payload: "{\n \"arm_mode\": \n  {\n    \"transaction\": \"{{ trigger.payload_json.action_transaction\
              \ }}\",\n    \"mode\": \"{{ trigger.payload_json.action }}\"\n  }\n}"
    - choose:
      - conditions:
        - condition: template
          value_template: '{{ trigger.payload_json.action_code == pin_var and trigger.payload_json.action
            == "arm_all_zones" }}'
        sequence:
        - service: alarm_control_panel.alarm_arm_away
          target:
            entity_id: !input 'control_panel'
          data:
            code: !input 'pin'
      - conditions:
        - condition: template
          value_template: '{{ trigger.payload_json.action_code == pin_var and trigger.payload_json.action
            == "arm_night_zones" }}'
        sequence:
        - service: alarm_control_panel.alarm_arm_night
          target:
            entity_id: !input 'control_panel'
          data:
            code: !input 'pin'
      - conditions:
        - condition: template
          value_template: '{{ trigger.payload_json.action_code == pin_var and trigger.payload_json.action
            == "arm_day_zones" }}'
        sequence:
        - service: alarm_control_panel.alarm_arm_home
          target:
            entity_id: !input 'control_panel'
          data:
            code: !input 'pin'
      - conditions:
        - condition: template
          value_template: '{{ trigger.payload_json.action_code == pin_var and trigger.payload_json.action
            == "disarm" }}'
        sequence:
        - service: alarm_control_panel.alarm_disarm
          target:
            entity_id: !input 'control_panel'
          data:
            code: !input 'pin'
      - conditions:
        - condition: template
          value_template: '{{ trigger.payload_json.action == "panic" }}'
        sequence:
        - choose:
          default: !input 'action_panic'
      - conditions:
        - condition: template
          value_template: '{{ trigger.payload_json.action_code != pin_var and trigger.payload_json.action_code
            | int(-1) != -1 }}'
        sequence:
        - service: mqtt.publish
          data:
            topic: !input 'z2m_keypad_path_set'
            payload: "{\n \"arm_mode\": \n  {\n   \"transaction\": \"{{ trigger.payload_json.action_transaction\
              \ }}\",\n   \"mode\": \"invalid_code\"\n  }\n}"
      - conditions:
        - condition: template
          value_template: '{{ trigger.payload_json.action == None }}'
        sequence:
        - choose:
          - conditions:
            - condition: state
              entity_id: !input 'control_panel'
              state: armed_home
            sequence:
            - service: mqtt.publish
              data:
                topic: !input 'z2m_keypad_path_set'
                payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_day_zones\"\n\
                  \  }\n}"
          - conditions:
            - condition: state
              entity_id: !input 'control_panel'
              state: armed_away
            sequence:
            - service: mqtt.publish
              data:
                topic: !input 'z2m_keypad_path_set'
                payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_all_zones\"\n\
                  \  }\n}"
          - conditions:
            - condition: state
              entity_id: !input 'control_panel'
              state: armed_night
            sequence:
            - service: mqtt.publish
              data:
                topic: !input 'z2m_keypad_path_set'
                payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_night_zones\"\n\
                  \  }\n}"
          - conditions:
            - condition: state
              entity_id: !input 'control_panel'
              state: disarmed
            sequence:
            - service: mqtt.publish
              data:
                topic: !input 'z2m_keypad_path_set'
                payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"disarm\"\n\
                  \  }\n}"
          - conditions:
            - condition: state
              entity_id: !input 'control_panel'
              state: arming
            - condition: state
              entity_id: !input 'control_panel'
              state: armed_home
              attribute: next_state
            sequence:
            - service: mqtt.publish
              data:
                topic: !input 'z2m_keypad_path_set'
                payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_day_zones\"\n\
                  \  }\n}"
          - conditions:
            - condition: state
              entity_id: !input 'control_panel'
              state: arming
            - condition: state
              entity_id: !input 'control_panel'
              state: armed_away
              attribute: next_state
            sequence:
            - service: mqtt.publish
              data:
                topic: !input 'z2m_keypad_path_set'
                payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_all_zones\"\n\
                  \  }\n}"
          - conditions:
            - condition: state
              entity_id: !input 'control_panel'
              state: arming
            - condition: state
              entity_id: !input 'control_panel'
              state: armed_night
              attribute: next_state
            sequence:
            - service: mqtt.publish
              data:
                topic: !input 'z2m_keypad_path_set'
                payload: "{\n \"arm_mode\": \n  {\n   \"mode\": \"arm_night_zones\"\n\
                  \  }\n}"
      default: []
  default: []
mode: parallel
max: 10

Hello Everyone,

I am new to Home Assistant and Alarmo however for the past week I have been trying to sync my Xfinity XHK1-UE keypad to my alarmo and Iā€™m about 80% there.

I have downloaded alarmo and I have installed this blueprint on this page. The keypad is working for Home and Away set modes and accepting my set pin code, but the night mode doesnā€™t work/set with my default pin code. Any ideas?

Please could someone help me.

Kind regards
M

Hello together and many thanks for the great Blueprint. Bit I have on question, what is right way to use the RFID Tag. What do I have to write on the tag or what do I have to enter where in Alarmo, unfortunately I havenā€™t understood it yet. I have the Frient Keypad KEPZB-110

Thanks AndrejDelany for the Blueprint, everything works well on my end ! Would it be possible to add a toggle to input / or not the pincode when arming the alarm ? Adding fields for other action_code to support RFID badges would be also a great idea as they are just added in the payload

If this means, that you want to activate the alarm without typing in the pin, this is not possible. My keypad only sends a zigbee signal if the pin code is entered first.

Actually I donā€™t own a keypad with rfid support, so implementing this is quite difficult for me. But community contributions by the community are always welcome!

1 Like

Thanks for the quick reply !

It is not the case for my ā€œFrient KEPZB-110ā€, any button press sends a Zigbee event, even an empty one sometimes.

Iā€™m currently trying to edit your blueprint to accomodate my needs. Iā€™ll let you know if I succeed in doing so !

EDIT : Iā€™ve sucessefully added support to enable/disable pin codes when arming the alarm and also support for multiple RFIDs to be used as ā€œcodesā€. Iā€™ll try to use it normaly to see if any bugs pops-up and will share the blueprint then.

1 Like

Hi is there any way to get this working with Hive Keypad & ZHA ?

Thanks

As this blueprint is heavily coupled to zigbee2mqtt. It would require a complete rewrite to make this work with ZHA.

The develco/frient keypad sends an emergency action instead of panic when pressing the SOS button. I got the panic action working when I change following line in in the blueprint

                    value_template: >-
                      {{ trigger.payload_json.action == "panic" }}

With

                    value_template: >-
                      {{ trigger.payload_json.action == "panic"  or trigger.payload_json.action == "emergency" }}

Also, it seems the SOS is only activated when pressed 3 times shortly, an organge led will start blinking

any chance you can share it @Pekno I have the same device, same issue :slight_smile: