Xfinity xhk1-ue - Zigbee Keypad

And in case you needed the automation:

alias: Keypad Test
description: 'Triggers an Event When code 1111 is entered into any keypad. Add device IEEE for specific keypad control'
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      command: 'arm'
      args:
        arm_mode: 0
        arm_mode_description: 'Disarm'
        code: '1111'
        zone_id: 0
condition: []
action:
  - device_id: c1a07cc25e3dca46120c36f9dd3874a6
    domain: light
    entity_id: light.desk
    type: flash
mode: single
4 Likes

Thanks for this. I’ve been trying to use an xfinity keypad using this automation to open my garage door. It seems to work really well ~30% of the time. But the other 70% it’s completely non-responsive / the automation does not run.

I tried listening for zha_event(s) using dev tools, and am not seeing anything when entering numbers on they keypad. I even upgraded/added some new zigbee repeaters, to no avail. I’ve had similar issues trying to listen to Zha events with other battery powered devices too. Any tips for making this work reliably?

1 Like

Okay, so if you’re looking at zha_event and nothing’s happening it could be caused by:

  • The batteries could be low/dead. Sometimes with batteries that “seem” to work – the keypad lights up, etc – the batteries could still be too low to properly throw events. Check the device info for the keypad and see it’s last check-in time. The keypad should be throwing a “checkin” event to zha_event periodically. If it’s not doing that, the keypad probably needs new batteries.

  • The keypad could be armed. That automation I wrote depends on the system being disarmed and putting in a code. If it’s armed, nothing should happen as a security feature. You could try editing the automation to change the command and arg list.

  • The keypad could be improperly paired to your network. Make sure you’re not using a custom zha quirk for the device, then try deleting the device from your network and resetting the keypad using the instructions here

2 Likes

Thanks for the reply. The batteries are brand new, so should be fine. I don’t think I have an arming code set, so not sure how it could have gotten armed… but… any way to make it parse a 4 digit code regardless of armed status? I really just want to use it as a number pad and not as part of a security system, so armed/disarmed status is not relevant.

If it’s not giving you a zha_event at all, then there’s nothing for the automation to be triggered.

If you didn’t set an arming code in the ZHA configuration panel, that might be the cause of it not throwing a zha_event. Go to Settings—>Devices and Services—>ZHA—>Configure—>Alarm Control Panel Options.

Make sure that you have a master code in there and the code required box is unchecked. Then press “update configuration” and listen to the zha_event.

Keep in mind the zha event will only trigger with a 4 digit code. Pressing 3 or fewer numbers will do nothing. That’s hard coded into the device from what I can tell. The A and B buttons also do nothing and can’t be used.

Thanks. I set a master alarm code in my Zha config, but it didn’t make a difference. Both the network light and the indicator on the front of the keypad were solid green.

I then pulled out a battery, pressed and held the tamper/pair button for a few seconds, and put the battery back in… after doing that, I was able to “arm” the keypad (indicator now red) using the master code I set, and then use the (other) code from my automation to open/close the garage door as expected.

Not exactly sure what fixed it, but it seems it got into a weird state and is working fine now. Thanks for the help!

1 Like

Maybe I spoke too soon… it’s back to doing nothing :frowning:

(But pulling a battery and pressing the tamper button while replacing it again gets it working again)

That doesn’t sound great, I’m sorry. Based on how it’s behaving it seems like it’s losing connection to the network. What kind of coordinator are you using? You said you’re also using repeaters–what kind?

It sounds like you may have a flaky network, which I definitely did for the longest time. My guess is that you have a repeater not working right. I had constant issues with the Ikea and Tuya repeaters until I removed them from my network completely. Certain weird or old accessories could also be the culprit as I’ve had some SwannOne Plugs and Tuya Air Boxes both cause havoc too. You may have to fiddle with a lot of things to get this sorted out, unfortunately.

fwiw: If you’re looking for a good repeater, get Tube’s Router. With the antenna, the range is amazing and It’s made the furthest edge of my network much happier.

I removed my ikea repeater last week and replaced it with a two sonoff s31s.

One of those is ~5ft from this keypad. Am still using a HUSBZB-1 as the coordinator because we have zwave and zigbee devices. Maybe time to upgrade?

The keypad works 100% of the time if I pull a battery, press the tamper button, put the battery back, wait until the green light in the battery compartment goes out, and then release the tamper button.

But after 5-10 minutes, it stops working again. It’s very odd.

Is your coordinator on a usb 2.0 extension cable at least 3 feet from your server? Most of the dongles perform better when kept away from the machine to reduce interference.

I don’t use that nortek coordinator, but I have read of folks having some issues with it. I’ve got a Conbee stick and it will perform badly unless I have it about 6’ away from the server and within line of sight to a plug or bulb. (My house is very old with a lot of lead paint and thick plaster walls)

Have you tried deleting your keypad from zha, reset the keypad, then paired it next to the coordinator and tested? I only suggest this because it’s possible you have defective keypad.

Did you get anywhere with the keypad going offline? Everytime I restart HA, the keypad loses connection, it’s pretty irritating

No, it still doesn’t work reliably. I haven’t had time to really dive in further though.

1 Like

I have a Sonoff zigbee 3.0 plus P I use z2m and I have a xhk1 that is very far away from the coordinator. I don’t have any mesh devices and I have not run into any problems with the keypad.

Thanks Isaias, I’ve finally taken your advice and added another coordinator and z2m. The keypad is finally reliable!

1 Like

I just got the Xfinity Zigbee Keypad and was able to write some ZHA automations using the zha_event from the Keypad to set Alarmo Arm Away/Disarm. The problem is I can’t find the correct Alarmo service code for Home Away.

You probably know, but the sequence on the keypad is to press one of the top buttons with icons for Disarm/Arm Away/Arm Home, followed by your 4-digit PIN. This throws the zha_event. Based on the the Arm Mode Description (Arm_All_Zones, Arm_Night_Sleep_Only, or Arm_Day_Home_Only), I set Alarmo to the appropriate mode. My code is below.

Problem is I cannot find the Alarmo Arm Home Service call. The other two are service: alarmo.arm and service: alarmo.disarm. arm just sets Arm Away. Does anyone know what the service call is for Alarmo Arm Home?

My code:

- id: '1681839081579'
  alias: Alarm KeyPad Disarm
  description: ''
  trigger:
  - platform: event
    event_type: zha_event
    event_data:
      command: arm
      args:
        arm_mode_description: Arm_Day_Home_Only
  condition: []
  action:
  - service: alarmo.disarm
    data:
      entity_id: alarm_control_panel.alarmo
      code: '{{ trigger.event.data.args.code }}'
  mode: single
- id: '1681841666611'
  alias: Alarm KeyPad Arm Away
  description: ''
  trigger:
  - platform: event
    event_type: zha_event
    event_data:
      command: arm
      args:
        arm_mode_description: Arm_All_Zones
  condition: []
  action:
  - service: alarmo.arm
    data:
      entity_id: alarm_control_panel.alarmo
      code: '{{ trigger.event.data.args.code }}'
  mode: single
- id: '1681842591517'
  alias: Alarm KeyPad Alarm Home
  description: ''
  trigger:
  - platform: event
    event_type: zha_event
    event_data:
      command: arm
      args:
        arm_mode_description: Arm_Night_Sleep_Only
  condition: []
  action:
  - service: alarmo.arm_home **(This is not correct, I need the correct Arm Home code)**
    data:
      entity_id: alarm_control_panel.alarmo
      code: '{{ trigger.event.data.args.code }}'
  mode: single

Update: @neliss provided the answer, many thanks to him:

- service: alarmo.arm
    data:
      entity_id: alarm_control_panel.alarmo
      code: '{{ trigger.event.data.args.code }}'
      mode: home # can be any of away/home/night/vacation/custom

In case anyone searching ends up here, there is a super easy blueprint to integrate this keypad with Alarmo: Zigbee2MQTT - Sync Keypad and Alarm Control Panel States - #99 by Tykan

1 Like

In case anybody would like to use this with ZHA instead of Zigbee2Mqtt, I created a repo with blueprints, sample scripts and dashboard to make it easy to configure user codes.

By default 4 user codes are created as well as 2 one-time user codes. The one-time user codes get reset to 0000 (disabled) after each use.

Just enter a 4-digit code on the keypad and let the scripts assigned in the automation do whatever action you wish.

More details can be found here: HA Zigbee Keypad

The look and feel of the dashboard was inspired by Keymaster integration:


1 Like

Hi, I have trouble connecting the keypad to z2m.
I did all the steps, the tamper button is blinking 3 times, then a pause, then again 3 times.
z2m is on and in ‘enable join’ mode. still nothing is showing up on z2m. the device is not pairing.
What am I missing?

For some reason, the sonoff dongle P does not pick up the keypad to connect.
I tried via zha and a conbee II and it worked…

Very nice ty