[RELEASE] Virtual Keypad

Ok...i will need to start with getting the keypad to work and then work on overall dashboard setup.

Can someone provide a step by step on how to get a button to take an action e.g. what are the steps that need to be done so that HSM will be armed when I hit the "arm" button? I have review this thread, but wasn't able to dig out much config related info.

So Ill assume you followed the instructions in the first post and you have a Keypad dashboard setup (numbers/command buttons/etc), but it has the default key mappings (or no key mappings) for the command keys (when pressed they do nothing).

You will want to make sure you have configured the Keypad child APP to ensure the keypad device will control HSM. This will create the HSM child buttons under the Keypad device (that the App created automatically).
You will then need to add those child devices to your keypad dashboard (white list them in the dashboard app settings so you can use those devices on the dashboard).

Now you should be able to click the 3 dots on the "Arm" button on the keypad dashboard, change the device to the child "HSM-Arm" button and click done. Now when you click the arm button on the dashboard (if you require a code, and a code has been entered) it should run the HSM arming command.

This is the same process for any of the configurable commands (child buttons) for the keypad. Because of the options available, and different use cases for people's setups, I wanted to keep this addon open for customizations, but that also makes it harder to setup the first time until you understand how the app/device and dashboard interact.

Let me know if you have more questions while setting the keypad up. Its likely others have or will come up against similar issues and posting here can help everyone.

And also let me know if you have any requests for functionality that can add value to this addon.

1 Like

Ok, I was able to get Arm working by listing it as not requiring a code. However, I am wanting to require a code for "Disarm" and am not able to get it to work. I set the PIN using the "Lock Code Manager" app.

@mbarone I just noticed that after I ran the update for the Virtual Keypad app, it no longer gives the feedback in the input window when you enter a bad code. Previously, it would say 'input denied' when you entered a bad code, but now it doesn't do anything. Not a huge issue, but I figured I'd let you know.

Is there a way to change the InputDisplay to something other than "Enter Code"

Would there be a way to add this keypad to this dashboard app?

Virtual Keypad
V1.0.12: 2021-02-14

  • added preference to customize inputDisplay default text
  • bugfix - input display did not give feedback for bad code input or properly clear bad codes.

@83d56488e3747379796b thanks for the bug report.. missed 1 reference to the inputDisplay when I consolidated code when updating the timing function and also it was not clearing the bad code correctly.

@fshelton - there is now a preferences option in the keypad device to change the default text for the inputDisplay

regarding the issue with the code. please enable debug logging on the keypad device, and take a screenshot of your log screen for me when you try to get disarm working with a code (provided there is no sensitive data in it).

If the Android dashboard app can add iFrame tiles.. then it should be able to work, provided you make your keypad dashboard available to the internet. This addon may not work directly with 3rd party dashboards depending on how they implement the tiles. But if they offer an Iframe tile, then point at the internet address of your keypad dashboard on hubitat. you could also just add each keypad child device you need to re-create the keypad in the android dashboard app. This may be hard to get the look/aspect ratio correct, which is one of the reasons i went with the iframe method for this addon.

I will say, I would personally not put the keypad dashboard on the internet for security reasons.. i use a vpn on my phone when not at home to see my hubitat dashboards.

How do you get the keypad to be in it's own square on your dashboard? If it involves CSS and iframes, where would I be able to find a simple example to try to use to learn how to do this on my own dashboard?

I was able to get the Disarm to work. For some reason, it took a couple of tries to get the PIN code manager app to store my code.

Ok, glad the code/disarm is working properly. I need to circle back around with the hubitat team and see if there is a fix for the set code function on the keypad device so we dont have to use PIN Code Manager App. This changed with 2.2.4, which re-arranged the input names for the function which do not match their documentation (see above in thread for more discussion) and cause an error when run from the keypad device screen.

There is a good CSS/dashboard thread here with some good tips on customizing the dashboard:

In the first post of this thread there are instructions for setting up your keypad dashboard including JSON and CSS you can import to lessen the work needed. Then there are these instructions to use the preference iFrame in the keypad device to put your keypad dashboard onto another dashboard (its own square on another dashboard):

Adding the Keypad dashboard to other Dashboards

Once you have the custom Keypad dashboard setup, use the main Keypad device to add this keypad dashboard to other dashboards. Get the direct local legacy link to the keypad dashboard, and add it to the "Keypad Dashboard Url for iFrame" preferences in the main Keypad device.

you can use tokens and the Local LAN link, but it will be more complicated to manage if you have multiple users who need to access the keypad dashboard.

Add your main Keypad device to your other dashboard you want to include the keypad on and specify attribute: Keypad

you will want to apply this custom CSS to any dashboard you add the Keypad iFrame to help format it better:

Custom CSS
/* keypad iframe specific - #tile-25 is the Keypad device - attribute: Keypad */
#tile-25 .tile-title {
#tile-25 .tile-contents {
padding: 0;
#tile-25 .tile-primary {
padding: 0;

edit, and you asked for details so you could do this with other stuff..
you will still want to use the same css i posted above when using any iframe so they look better. you can check out this device driver that is only an iframe driver for hubitat. its a generic version of the same function i use in this keypad app for embedding on other dashboards. you would create a new virtual device and give it this driver in hubitat. Then add the url to the iFrame preference. Add this device to any dashboard, using attribute iFrame, and it will show whatever url you put in the preferences.

1 Like

@mbarone I have some problems with the latest update. I upgraded the app, and went into the child app and pressed done so that it would update. After that, my keypad no longer works. None of the button presses show up in the inputdisplay as *, and if I type in my code and try to arm, it just says Input Denied. If I press the clear button, the display says null. I checked all of the devices, and everything looks the same, but it's definitely not happy. I rebooted to see if that would help at all, but no joy. I ended up having to restore from a previous backup to roll it back to the previous version. All is back working now on the older version (v1.0.11). Not sure what happened, but it's broke. I can try upgrading again to get log data if there's anything specific you need. Thanks.

edit, see post below with update to V1.0.14

I had to go into the keypad device, not the child app (though I went there, too), and then it worked. I first went to the keypad child app and had a similar problem, but once I went to the virtual keypad device and clicked "Save Preferences" things were fine.

Virtual Keypad
V1.0.14: 2021-02-15

  • bugfix - forced setting a standard InputDisplayDefaultText if value is null which was causing issues with users upgrading as it wasnt getting set by default for some reason.

Thanks to @BrianP who helped me narrow down the root cause of this issue. The new InputDisplayDefaultText did not set itself automatically (even though it has a default value set) so when it got called to form the text value to display it would break the remaining functionality.

@83d56488e3747379796b Can you update to the latest and see if it resolves this issue for you.

no one should have to save the preferences of the keypad device after updating now, but i would open the child app and hit done just in case there was a change on that side that needs to be synced to the keypad device... but if someone could confirm this is resolved that would be great.

I upgraded, and it's working (sort of). I'm able to arm/disarm without issues, but I do see a couple of small issues.

  1. If I set Arm-Away and then immediately try to cancel the timer by typing in the code and pressing cancel, it gives me an Input Denied error. If I try a second time, it works fine and cancels the timer. I noticed that on the first attempt, when I'm typing in my code, it still has the countdown visible, but when I try the second attempt, it starts from a clear screen and it works. I tried to clear the screen using the clear button and typing in the code for the first try after arming, but it still gives me the Input Denied error. Second attempt always seems to work. I also noticed that when I'm typing the first attempt, it's displaying the countdown, and then a 'pipe' and then the code asterisks. See screen shot below:
    Virtual Keyboard Countdown Cancel Error
  2. Chime no longer works - I was using the countdown chime that you added (thank you), but I noticed that it stopped working a couple of updates ago (v10 I think). I was going to mention it, but saw that you were working the other issues, so I figured I'd wait. Basically, the Tile isn't flashing anymore, and my rule can't detect the press of the button by Virtual Keyboard. When I press the button manually from the devices view, RM triggers and works just fine. I noticed that the log never shows that the button was pressed by VK unless I turn on debug. I turned on debug to see what was going on and here's what I see. Notice that RM never triggers when VK is supposed to be pushing the chime button:
    Logs when Armed-Away Countdown is running and Virtual Keypad is pressing the chime button (debug on):

dev:14772021-02-15 09:15:29.426 pm debugoff() called
dev:14772021-02-15 09:15:28.913 pm debugon() called
dev:14772021-02-15 09:15:24.129 pm debugoff() called
dev:14772021-02-15 09:15:23.615 pm debugon() called
dev:14772021-02-15 09:15:18.790 pm debugoff() called
dev:14772021-02-15 09:15:18.262 pm debugon() called
dev:14772021-02-15 09:15:13.468 pm debugoff() called
dev:14772021-02-15 09:15:12.954 pm debugon() called
dev:14772021-02-15 09:15:08.189 pm debugoff() called
dev:14772021-02-15 09:15:07.670 pm debugon() called
dev:14772021-02-15 09:15:02.877 pm debugoff() called
dev:14772021-02-15 09:15:02.325 pm debugon() called

Logs when manually pressing the Virtual Keypad Chime button from the devices page:

app:14792021-02-15 09:16:04.426 pm infoAction: beep() on Piezo Buzzer 2
app:14792021-02-15 09:16:04.402 pm infoHSM - Arming Countdown Triggered
app:14792021-02-15 09:16:04.397 pm infoHSM - Arming Countdown : Main HSM Keypad (Chime) pushed 1
dev:14772021-02-15 09:16:04.309 pm debugpush(null) called using Chime

Not sure what happened on that one, but I figured I'd let you know.

  1. This is just a request - I like the chime option, but I noticed that it does get annoying after a while if you're home and arm the house (say I want to go out to the store, but the wife is at home taking a nap). I like to be able to set a different 'arm' option to arm HSM w/o the beeping if possible. I was trying to use the custom-arm functions, but none of them seem to trigger when the countdown starts (although, that may be a bug too). It's like VK isn't triggering anything other than the standard HSM-arm/disarm commands.

Virtual Keypad
V1.0.15: 2021-02-15

  • bugfix - proper handling of cancel countdown and update display
  • added option in app to specify which delayed commands get the chime during the countdown
  • added option to test chime from child device page with 'on' or 'push' commands

Thanks for your bug reports.. The cancel timer update was a big change to several core functions and I definitely didnt test as much as i did before releasing the initial version.

to answer your questions:
1 - fixed in new update 1.0.15 the code was not properly handling the cancel of the timer.. it was actually cancelling the timer, but started the countdown again. as you noted, the | **** only showed up the first time, because the 2nd time the 'real' timer was already cancelled.. just didnt exit properly.

2 - . hmm.. I didnt really change the chime functions or child device since it was released.. so not sure why that would stop working. The on() off() calls look correct.. as the chime trigger device is just a switch that turns on to trigger a chime and auto turns off after 500ms
I didnt setup the chime device to be able to be tested by pressing it manually, but I just added it in the new 1.0.15 release.. so you should be able to test the chime by pressing the 'on' or 'push' commands on the device page, or if you added the chime device to a dashboard as a button, it will now trigger the chime when pressed.

3 - totally.. it would get annoying and i dont have it connected to anything audible, so this hasnt come up for me.. yet. but i can see the value in a timed exit while others are home.
there is a new option in the app to specify which delayed commands you want to have the chime exit on for.

Let me know how the new version is.. there may be a few edge cases that need to be handled better, but it should be pretty close to normal functionality now.

My Virtual Keypad was working great until this last update.
All I get now is "Input Denied" in the "inputDisplay" button and any keypad button is non-functional. I have saved (several times now) my virtual keypad child (and the virtual keypad manager) in Apps Code. In drivers code I tried saving them all again. Restarted it. Several times now.
Is there any I can do to bring it back?
It was working last night when I set armedHome.
Good thing I have some Centralite keypads.
Will restore from backup help?

Hey, I apologize for the issues with this last set of updates.. I wanted to get it out for people to check out the new features, but didnt fully test on my end and it was a large change to the core timing and command functions. It would be nice to be able to mark beta releases in HPM so not everyone will update unless they understand it may need a little bug reporting and patching.

i just created a new child keypad app, with just HSM options and no delay. the new keypad device all seems fully functional with no other changes on my end with the newest version.
*end edit

First, make sure you are on the latest update from HPM.. it should resolve the "Input Denied" issue that was reported earlier yesterday. you can do this by also checking the version of the child app at the bottom of the app page.. it should be "Virtual Keypad Child - 0.0.7"

In the next release, there will be a version state on the keypad device as well.

What would help is copying your keypad "State Variables" and pasting them here or DM me, so i can see what settings you are using to try and reproduce the errors, and also enable debug logging for the keypad device and copy and past that for me as well.

If you just want to revert to a previous version, here is a .zip of the previous stable version before the big recent changes.

just download the .zip, and copy each files content into your hubitat app or driver area to overwrite the same newer version that HPM put there. This will cause some issues later if you want to update with HPM (i think there is a matching function to get HPM to re-assign the updates for an app that you have manually changed)

Hopefully one of those will get you back up and running at least.. and I will continue to look at the edge cases where these errors are occurring.

@kutoroff Yes, a restore would also fix it (obviously, the backup needs to be from before the app upgrade was done). One thing I've learned when dealing with custom apps and drivers on HE is to always do a backup before I update anything. I've been bitten too many times by bugs, and the HE restore process is pretty rock solid. I usually use the 'Create new backup and download locally' option which only takes a few seconds, but can save hours of frustration. That way, I don't lose anything I was working on since the last backup was done. One thing I love about HE is the developer community, but we're all humans and prone to errors. Having an 'undo' button is handy.

I already did the restore and as you say, the HE restore option is solid and brought me back to Jan 31 when I made my last HE change and saved it.
I'll update VK in a few days. I just moved my Konnected Pro board to POE and now I am removing the old keypads before I remove the legacy alarm board.
I'll be updating VK soon,
Thanks for the work on it, It has been a fun project to set up and use.


1 Like

Download the Hubitat app