Zigbee2MQTT - Sync Keypad and Alarm Control Panel States

Yes they should all do the same.

Okay. I probably won’t add this to the blueprint, however you can do it yourself quite easily by adding another pin-variable to the blueprint.

No problem I can mod the Blueprint myself, but you got any good idea how to implement a second variable nicely in the code?

Just add another variable in the input section and in the lower in the code.

I love this blueprint
BIG BIG THANKS on this place :slight_smile:

No chance to get it work with my linkind without your print!!!

One question
i suited up the pin in the device itself, is it possible to ARM the alarm panel withou typing the pin into the keypad
In the normal lovelace “pad” its possible like this

Maybe its super easy and i don’t recognize how to do it

Arming without entering the pin is not possible, becouse the keypad does not send anything via zigbee if you have not entered a pin.

1 Like

This is so amazing! Thanks so much. The only thing im not getting to work is arming the night mode. Any chance you could offer some guidance on how to troubleshoot on my end? Arm home and arm away are working great!

Please check which actions your keypad supports. Currently the blueprint supports arm_all_zones, arm_day_zones, panic and disarm. The blueprint doesn’t support arm_night_zones, as I haven’t seen a keypad using it. Which are you using? Does it utilize arm_night_zones?

Thanks. I have this keypad Universal Electronics Inc XHK1-UE control via MQTT | Zigbee2MQTT

It does have support for : disarm , arm_day_zones , arm_night_zones , arm_all_zones , invalid_code , not_ready , already_disarmed

Please check what action is triggered on the button that is not working for you. You can use the Zigbee2MQTT log to do so.

MQTT publish: topic 'zigbee2mqtt/Alarm Keypad', payload '{"action":"arm_night_zones","action_code":"1234","action_transaction":39,"action_zone":23,"battery":100,"battery_low":true,"contact":true,"linkquality":90,"occupancy":true,"presence":null,"tamper":false,"temperature":21,"voltage":5300}'

That is the line from the log

Okay, then you’re out of luck with this blueprint, unfortunately. The keypads I use can only switch between two armed modes, not three.

Of course, if you want to, you can work your way in and add the third mode to the blueprint. Contributions are always welcome.

Sounds great. The blue print does work great for me, just the one button doesn’t work using it. I will try to figure out what to change to make it work and then share it. Thanks so much, this is what I always wanted and a big reason I switched from deconz.

Working great with my Technicolor XHK1-TC (Technicolor XHK1-TC control via MQTT | Zigbee2MQTT).
Modified the blueprint since it was missing arm_night_zones.

blueprint:
  name: Alarmo Keypad Sync with nightmode
  description: Keypad sync with Alarmo added nightmode
  domain: automation

  input:
    state_topic:
      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"
      selector:
        text:
    set_topic:
      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"
      selector:
        text:
    entity:
      name: Alarmo entity
      description: "An alarm control panel entity from alarmo."
      selector:
        entity:
          domain: alarm_control_panel
          integration: alarmo

trigger:
  - platform: state
    entity_id: !input entity
    to: disarmed
    id: to_state_disarmed
  - platform: state
    entity_id: !input entity
    to: armed_home
    id: to_state_armed_home
  - platform: state
    entity_id: !input entity
    to: armed_night
    id: to_state_armed_night
  - platform: state
    entity_id: !input entity
    to: armed_away
    id: to_state_armed_away
  - platform: state
    entity_id: !input entity
    to: arming
    id: to_state_arming
  - platform: state
    entity_id: !input entity
    to: pending
    id: to_state_pending
  - platform: state
    entity_id: !input entity
    to: triggered
    id: to_state_triggered
  - platform: mqtt
    topic: !input state_topic
    id: keypad_command
  - platform: event
    event_type: alarmo_failed_to_arm
    id: event_arm_failure
  - platform: event
    event_type: alarmo_command_success
    id: event_command_success
condition: []

action:
  - choose:
      - conditions:
          - condition: trigger
            id: to_state_disarmed
        sequence:
          - service: mqtt.publish
            data_template:
              topic: !input set_topic
              payload: |-
                {
                  "arm_mode": 
                  {
                    "mode": "disarm"
                  }
                }
      - conditions:
          - condition: trigger
            id: to_state_armed_home
        sequence:
          - service: mqtt.publish
            data_template:
              topic: !input set_topic
              payload: |-
                {
                  "arm_mode": 
                  {
                    "mode": "arm_day_zones"
                  }
                }
      - conditions:
          - condition: trigger
            id: to_state_armed_night
        sequence:
          - service: mqtt.publish
            data_template:
              topic: !input set_topic
              payload: |-
                {
                  "arm_mode": 
                  {
                    "mode": "arm_night_zones"
                  }
                }
      - conditions:
          - condition: trigger
            id: to_state_armed_away
        sequence:
          - service: mqtt.publish
            data_template:
              topic: !input set_topic
              payload: |-
                {
                  "arm_mode": 
                  {
                    "mode": "arm_all_zones"
                  }
                }
      - conditions:
          - condition: trigger
            id: to_state_arming
        sequence:
          - service: mqtt.publish
            data_template:
              topic: !input set_topic
              payload: |-
                {
                  "arm_mode": 
                  {
                    "mode": "exit_delay"
                  }
                }
      - conditions:
          - condition: trigger
            id: to_state_pending
        sequence:
          - service: mqtt.publish
            data_template:
              topic: !input set_topic
              payload: |-
                {
                  "arm_mode": 
                  {
                    "mode": "entry_delay"
                  }
                }
      - conditions:
          - condition: trigger
            id: to_state_triggered
        sequence:
          - service: mqtt.publish
            data_template:
              topic: !input set_topic
              payload: |-
                {
                  "arm_mode": 
                  {
                    "mode": "in_alarm"
                  }
                }
      - conditions:
          - condition: trigger
            id: keypad_command
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: '{{ trigger.payload_json.action == "disarm"  }}'
                sequence:
                  - service: alarmo.disarm
                    data:
                      entity_id: !input entity
                      code: "{{ trigger.payload_json.action_code }}"
                      context_id: "{{ trigger.payload_json.action_transaction }}"
              - conditions:
                  - condition: template
                    value_template: '{{ trigger.payload_json.action == "arm_all_zones"  }}'
                sequence:
                  - service: alarmo.arm
                    data:
                      entity_id: !input entity
                      mode: away
                      code: "{{ trigger.payload_json.action_code }}"
                      context_id: "{{ trigger.payload_json.action_transaction }}"
              - conditions:
                  - condition: template
                    value_template: '{{ trigger.payload_json.action == "arm_day_zones"  }}'
                sequence:
                  - service: alarmo.arm
                    data:
                      entity_id: !input entity
                      mode: home
                      code: "{{ trigger.payload_json.action_code }}"
                      context_id: "{{ trigger.payload_json.action_transaction }}"
              - conditions:
                  - condition: template
                    value_template: '{{ trigger.payload_json.action == "arm_night_zones"  }}'
                sequence:
                  - service: alarmo.arm
                    data:
                      entity_id: !input entity
                      mode: night
                      code: "{{ trigger.payload_json.action_code }}"
                      context_id: "{{ trigger.payload_json.action_transaction }}"
      - conditions:
          - condition: trigger
            id: event_arm_failure
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ trigger.event.data.reason == 'invalid_code' }}"
                sequence:
                  - service: mqtt.publish
                    data_template:
                      topic: !input set_topic
                      payload: |-
                        {
                          "arm_mode": 
                          {
                            "transaction": {{ trigger.event.data.context_id }},
                            "mode": "invalid_code"
                          }
                        }
              - conditions:
                  - condition: template
                    value_template: "{{ trigger.event.data.reason == 'open_sensors' }}"
                sequence:
                  - service: mqtt.publish
                    data_template:
                      topic: !input set_topic
                      payload: |-
                        {
                          "arm_mode": 
                          {
                            "transaction": {{ trigger.event.data.context_id }},
                            "mode": "not_ready"
                          }
                        }
              - conditions:
                  - condition: template
                    value_template: "{{ trigger.event.data.reason == 'not_allowed' }}"
                  - condition: template
                    value_template: "{{ trigger.event.data.command|lower == 'disarm' }}"
                sequence:
                  - service: mqtt.publish
                    data_template:
                      topic: !input set_topic
                      payload: |-
                        {
                          "arm_mode": 
                          {
                            "transaction": {{ trigger.event.data.context_id }},
                            "mode": "already_disarmed"
                          }
                        }
      - conditions:
          - condition: trigger
            id: event_command_success
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ trigger.event.data.action == 'arm' }}"
                  - condition: template
                    value_template: "{{ trigger.event.data.context_id != null }}"
                  - condition: template
                    value_template: "{{ trigger.event.data.mode == 'away' }}"
                sequence:
                  - service: mqtt.publish
                    data_template:
                      topic: !input set_topic
                      payload: |-
                        {
                          "arm_mode": 
                          {
                            "transaction": {{ trigger.event.data.context_id }},
                            "mode": "arm_all_zones"
                          }
                        }
              - conditions:
                  - condition: template
                    value_template: "{{ trigger.event.data.action == 'arm' }}"
                  - condition: template
                    value_template: "{{ trigger.event.data.context_id != null }}"
                  - condition: template
                    value_template: "{{ trigger.event.data.mode == 'home' }}"
                sequence:
                  - service: mqtt.publish
                    data_template:
                      topic: !input set_topic
                      payload: |-
                        {
                          "arm_mode": 
                          {
                            "transaction": {{ trigger.event.data.context_id }},
                            "mode": "arm_day_zones"
                          }
                        }
              - conditions:
                  - condition: template
                    value_template: "{{ trigger.event.data.action == 'arm' }}"
                  - condition: template
                    value_template: "{{ trigger.event.data.context_id != null }}"
                  - condition: template
                    value_template: "{{ trigger.event.data.mode == 'night' }}"
                sequence:
                  - service: mqtt.publish
                    data_template:
                      topic: !input set_topic
                      payload: |-
                        {
                          "arm_mode": 
                          {
                            "transaction": {{ trigger.event.data.context_id }},
                            "mode": "arm_night_zones"
                          }
                        }
              - conditions:
                  - condition: template
                    value_template: "{{ trigger.event.data.action == 'disarm' }}"
                  - condition: template
                    value_template: "{{ trigger.event.data.context_id != null }}"
                sequence:
                  - service: mqtt.publish
                    data_template:
                      topic: !input set_topic
                      payload: |-
                        {
                          "arm_mode": 
                          {
                            "transaction": {{ trigger.event.data.context_id }},
                            "mode": "disarm"
                          }
                        }
mode: parallel
max: 10
1 Like

Hi Paolo.
I have the same Develco Keypad and I’ve managed to get it working with this blueprint.
When armed and disarmed the keypad gives feedback with a ‘Beep’. If I have a arm delay, the keypad is not beeping during the countdown. It this the same for you?

Did you get this to work with more than one code?
If so, can you share how you did this?
Thanks :slight_smile:

I ended up using alarmo and then I made these automations to control the keypad.

I use two keypad so this can be done much simpler.

1 Like

Awesome!
Thanks for your help :slight_smile:

Have you figured it out? I am at the same spot right now. Everything works except the arm_night_zones.

if you are a moron like me scratching your head thinking you have it setup perfectly. please check for upper/lower case naming you have set!

my friendly name was set to keypad and in the blueprint i had zigbee2mqqt/Keypad

renamed zigbee friendly name to Keypad and suprise suprise it now works!