[RELEASE] Virtual Keypad

Skip this post if you are using the main Virtual Keypad app/driver

Virtual Basic Keypad

Components:

Drivers: Virtual Basic Keypad

Available via Hubitat Package Manager and through my github drivers section linked in the first post for manual install.

The Virtual Basic Keypad is a limited version which has a single driver component. This results in a single device with no child devices that only works with HSM commands, and has no external trigger options. This version is designed to replicate hardware keypads and their basic functions.

All buttons that are added to the Virtual Basic Keypad Dashboard must be manually configured by setting the "button number" input for each button:

0-9, Clear, Panic, armAway, armHome, armNight, disarm, armRules, disarmRules, disarmAll, armAll, cancelAlerts

Image of button settings:

Here are the JSON and CSS to help setup the keypad dashboard more quickly. You will need to edit each tile and specify your Virtual Basic Keypad device and ensure the "button number" is specified correctly for your intended function:

Keypad Dashboard JSON

{
"localization": "English",
"roundedCorners": 30,
"dateFormat": "MM/DD/YYYY",
"hideLabels": true,
"customColors": ,
"colWidth": "",
"cloudRefresh": 5,
"hsmPin": "",
"hide3dot": false,
"clockMode": true,
"gridGap": 8,
"tiles": [
{
"rowSpan": 1,
"template": "buttons",
"col": 2,
"colSpan": 1,
"id": 0,
"row": 5,
"device": "601",
"templateExtra": "0"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 1,
"colSpan": 1,
"id": 1,
"row": 2,
"device": "601",
"templateExtra": "1"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 2,
"colSpan": 1,
"id": 2,
"row": 2,
"device": "601",
"templateExtra": "2"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 3,
"colSpan": 1,
"id": 3,
"row": 2,
"device": "601",
"templateExtra": "3"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 1,
"colSpan": 1,
"id": 4,
"row": 3,
"device": "601",
"templateExtra": "4"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 2,
"colSpan": 1,
"id": 5,
"row": 3,
"device": "601",
"templateExtra": "5"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 3,
"colSpan": 1,
"id": 6,
"row": 3,
"device": "601",
"templateExtra": "6"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 1,
"colSpan": 1,
"id": 7,
"row": 4,
"device": "601",
"templateExtra": "7"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 2,
"colSpan": 1,
"id": 8,
"row": 4,
"device": "601",
"templateExtra": "8"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 3,
"colSpan": 1,
"id": 9,
"row": 4,
"device": "601",
"templateExtra": "9"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 1,
"colSpan": 1,
"id": 10,
"row": 5,
"device": "601",
"templateExtra": "Clear",
"customIcon": "refresh"
},
{
"rowSpan": 1,
"template": "attribute",
"col": 1,
"colSpan": 3,
"id": 11,
"row": 1,
"device": "601",
"templateExtra": "InputDisplay"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 4,
"colSpan": 2,
"id": 14,
"row": 3,
"device": "601",
"templateExtra": "armAway"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 4,
"colSpan": 2,
"id": 15,
"row": 4,
"device": "601",
"templateExtra": "armHome"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 4,
"colSpan": 2,
"id": 16,
"row": 5,
"device": "601",
"templateExtra": "disarm"
},
{
"rowSpan": 1,
"template": "buttons",
"col": 3,
"colSpan": 1,
"id": 17,
"row": 5,
"device": "601",
"templateExtra": "Panic",
"customIcon": "he-siren_and_alarm"
}
],
"goBack": true,
"modePin": "",
"bgColor": "Black",
"lanRefresh": 2,
"iconSize": 42,
"cols": 5,
"rowHeight": "",
"hideEvents": true,
"tempScale": "F",
"noColors": false,
"readOnly": null,
"rows": 5,
"hideIconText": true,
"name": "zzztest",
"fontSize": 12
}

Keypad Dashboard CSS

.header.flex {
padding:0 !important;
}
.wrapper {
overflow: hidden;
padding-right: 15px;
}
.dashBack.flex, .dashName.flex {
display:none;
}
.he-tap:before {
content: none;
}
.tile.button .tile-title, .tile.attribute .tile-title {
visibility: hidden;
display: none;
}
.tile.button .tile-contents, .tile.attribute .tile-contents {
height: calc(100%);
}
.tile.attribute .tile-primary, .tile.button .tile-primary {
padding:0;
}
#tile-1 .tile-primary :before {
content: "1";
}
#tile-2 .tile-primary :before {
content: "2";
}
#tile-3 .tile-primary :before {
content: "3";
}
#tile-4 .tile-primary :before {
content: "4";
}
#tile-5 .tile-primary :before {
content: "5";
}
#tile-6 .tile-primary :before {
content: "6";
}
#tile-7 .tile-primary :before {
content: "7";
}
#tile-8 .tile-primary :before {
content: "8";
}
#tile-9 .tile-primary :before {
content: "9";
}
#tile-0 .tile-primary :before {
content: "0";
}
#tile-10 .tile-primary :before {
#content: "Clear";
}
#tile-14 .tile-primary :before {
content: "Arm Away";
}
#tile-15 .tile-primary :before {
content: "Arm Home";
}
#tile-16 .tile-primary :before {
content: "Disarm";
}

The inputDisplay is now built into the main Virtual Basic Keypad device. To add this to your keypad dashboard, use the attribute: InputDisplay

inputDisplay on dashboard

The iFrame option is now built into the main Virtual Basic Keypad device. Get the direct URL for the Virtual Basic Keypad dasboard, and paste it into the main device preferences section for iFrame. To add this to any other dashboard, add the main Virtual Basic Keypad device to the dashboad, and specify attribute: Keypad

Keypad iFrame CSS

/* keypad iframe specific - #tile-25 is the Keypad device with attribute: Keypad */
#tile-25 .tile-title {
display:none;
}
#tile-25 .tile-contents {
padding: 0;
height:100%;
}
#tile-25 .tile-primary {
padding: 0;
}

Setting up the Panic Alarm using HSM

(instructions borrowed/edited from arnb's nyckelharpa app documentation)
A custom HSM Rule is required to force an HSM response to a Panic key press, enabling an instant Panic response even when the system is disarmed

  1. Click on Apps-->then click Hubitat Safety Monitor
  2. Click on Custom
  3. Click Create New Monitoring Rule --> Name this Custom Monitoring Rule-- enter Panic -->
  4. Rule settings What kind of device do you want to use: select "Tamper Sensor"
    Select Tamper Sensors: check the Virtual Basic Keypad device when using HE drivers , click Update
    What do you want to monitor?: Set Tamper Detected
    For how long? (minutes): must be empty or 0
    Set Alerts for Text, Audio, Siren and Lights
    Click the "Arm This Rule" button
    Click Done
  5. Important: verify the Panic rule is "Armed" or it will not work
  6. Do a Panic test: Press the Virtual Basic Keypad's Panic button and then a 2nd time within 5 seconds
  7. The Panic Alert may be stopped using any disarm command on the Virtual Keypad, if the option is selected to issue cancelAlert on any disarm which is enabled by default; or the "Cancel Alerts" button from HE App HSM options

Failed Code Input Messaging

If you have configured the Failed Attempts before Notify in the Virtual Basic Keypad device preferences, then upon the set number of failed code inputs, the attribute: Notifications will be updated with a failed code message. You can use RM to monitor this attribute for changes, and send/forward the message to any device you set in RM. The attribute: Notifications will automatically clear itself to "", so you want to handle that in your RM rule to exit the rule if Notifications changes to "".

Changelog:

Virtual Basic Keypad
V1.0.4: 2021-11-04

  • fixed security issue found by @arnb and @scubamikejax904, and added an option to enable or disable.. enabled by default

V1.0.3: 2021-03-10

  • removed the SecurityKeypad capability as this was causing issues when present with the LockCodes capability and is not needed for the functionality of this addon
  • FIXED code entry/update/delete from the keypad device. You do not need to use the "Lock Code Manager" addon.

V1.0.2: 2020-10-09

  • added attribute Notification, which updates with a bad code input message if enabled. this can be used to trigger a RM notification if you watch this attribute for changed

V1.0.1: 2020-10-09

  • initial release
1 Like