Keypad Subscribe Question

I have a simple app I used in ST allowing the keypad to be used for various automation functions based on the pin code. Since I'm unable to view the source for the HE Keypad DTH I need some assistance with these two questions:

  1. Will these subscribes function with the HE keypad DTH
    subscribe (thekeypad, "codeEntered", pinHandler)
    subscribe (thekeypad, "armMode", armModeHandler)

  2. When an undefined pin is entered, and assuming "codeEntered" is a valid subscribe, will it receive the invalid pin entries?

  3. If armMode is a valid subscribe, will a valid evt.value be "exitDelay"

1 Like

No, these are not correct.

For code entered you would subscribe to securityKeypad.disarmed. The code provided is sent as a json object.

For armed you would subscribe to securityKeypad and the event value would be "armed home", "armed night", or "armed away" (or "disarmed" or "cancelArm").

Since an invalid pin does not result in a disarm event, no event is sent in that case.

For exit delays a command is sent to the keypad to set the desired exit delay: keypadDevice.setExitDelay(seconds)
Then when one arms the keypad it begins the countdown.

Is an event issued on user pin entry prior to validating the pin? If yes, what is the event name.

Also is there any way to subscribe to all device events without knowing the attribute or event names?

No, only on successful pin entry.

Yes, you may subscribe to every event from a device, like this:

subscribe(myDev, handler)

Or you can subscribe to an attribute without an event value, like this:

subscribe(myDev, "switch", handler)

Or you can subscribe to a specific event value, like this:

subscribe(myDev, "switch.on", handler)

1 Like

Unfortunately, that kills the code I'm using with ST that has keypad pin codes do things like turning on/off lighting, open/close of my garage door, etc. without impacting the arm state or mode.

Any chance of issuing an event in the keypad DTH when a pin is entered prior to validation, or issuing a bad pin entered event? The bad pin event may also be used for security purposes.

:+1:

I'll pass this along as a feature request for the driver.

2 Likes

Setup a simple app to monitor all events on a simulated keypad device, and "securityKeypad" events, All events works, did not receive "securityKeypad" events when tapping/clicking the buttons in the device display

  • allEventHandler com.hubitat.hub.domain.Event@48d0c864 name: securityKeypad value: armed away data: null
  • allEventHandler com.hubitat.hub.domain.Event@1173747c name: securityKeypad value: disarmed data: null
  • allEventHandler com.hubitat.hub.domain.Event@6d52132e name: securityKeypad value: armed home data: null

Used the following code snippets
def initialize() {
subscribe (thekeypad, allEventHandler)
subscribe (thekeypad, "securityKeypad", securityKeypadHandler)

def allEventHandler(evt)
{
log.debug "allEventHandler $evt name: ${evt.name} value: ${evt.value} data: ${evt.data}"
}
def securityKeypadHandler(evt)
{
log.debug "securityKeypadHandler $evt name: ${evt.name} value: ${evt.value} data: ${evt.data}"
}

What is the driver for this?

Standard HE Centralite Keypad

Then how is it "simulated" ?

On Devices: Add Virtual Device, select Centralite Keypad
So it's virtual not simulated, my apologies for using wrong terminology, but it's not a pyhsical device.

Doing this does not get you a functioning "simulated" device. The driver is only going to process commands coming from a real keypad. It's parse method is looking for Zigbee messages, which you cannot send it. So you don't know what events it would send.

Drivers for virtual devices all have names like Virtual Dimmer...

I'm aware the virtual device is non functional. What I don't understand is why my app is posted with securityKeypad when tapping on a device status such as Disarmed from
subscribe (thekeypad, allEventHandler)

but not

subscribe (thekeypad, "securityKeypad", securityKeypadHandler)

when the events are "securityKeypad".

Do you have both subscribes in the same code, as shown above?

You clearly are getting securityKeypad events, as shown by your logs.

I tried a three iterations
both
subscribe (thekeypad, allEventHandler) only
subscribe (thekeypad, "securityKeypad", securityKeypadHandler) only

never posts on the subscribe (thekeypad, "securityKeypad", securityKeypadHandler) but does show that event in the event log when tapping "Disarm" on the device page

Show the app status page. Have you tried your app with a real keypad?

I have most devices moved to HE, except for keypads, repeater and siren that are waiting for the forthcoming update with Entry Delay/ Exit Delay support. Using hybrid system with ST and HE, Hublink, and Other Hub app. When that update is released, one keypad (Iris V2) moves to HE for evaluation.

Not sure what is meant by "app status page", but maybe it's this?

Click on the gear icon just to left of the app name on Apps page.

@bravenel @chuck.schwer

Is this still the correct syntax?
I've tried this with a couple of devices and it will only work using the attribute

e.g subscribe(myDev, "attribute", handler)

Using it without the attribute gets no subscription