[Release] SHM Delay Version 2.0

(Arn B) #69

WebCore is my suggestion for personalized device actions.

(Gareth Kirk) #70

Thanks - haven’t used that , but will look into it.

Just to update - used WebCore for the first time and wrote a very basic script to control the beeper. It works perfectly. The beeper activates as soon as the door is opened, and beeps in a loop with a 2 second delay until the system is disarmed or the alarm sirens sounds. What a great program, thanks for the heads up !!

Happy to post the script if anyone else might find that useful

(PZ) #71

0ad955bb-3fe3-47e1-b8b9-27dfed4d9e21 9:16:50 PM: info ||| NST Manager | API Device Data HAS Changed (POLL(ASYNC))
0ad955bb-3fe3-47e1-b8b9-27dfed4d9e21 9:16:50 PM: info ||| NST Manager | Updating Structure Data (Last Updated: 360 seconds ago) | Updating Device Data (Last Updated: 179 seconds ago) (async)
b483bac3-2c91-4280-9058-1c610b7318f9 9:16:35 PM: error java.lang.IllegalArgumentException: Property ‘c’ is not supported for devices @line 736 (motionActiveHandler)
b483bac3-2c91-4280-9058-1c610b7318f9 9:16:35 PM: debug value: open now: 1522372595715 startTime: 1522361589274 seconds 11006
f801b417-2a1c-4d0b-85f8-5b3586009080 9:16:35 PM: debug — Motion Detected
f801b417-2a1c-4d0b-85f8-5b3586009080 9:16:35 PM: debug Parsing 'catchall: 0104 0501 01 01 0140 00 2A0D 01 00 0000 07 00 ’
f801b417-2a1c-4d0b-85f8-5b3586009080 9:16:35 PM: debug — Motion Detected
f801b417-2a1c-4d0b-85f8-5b3586009080 9:16:35 PM: debug Parsing 'catchall: 0104 0501 01 01 0140 00 2A0D 01 00 0000 07 00 ’
9:16:34 PM: info Waiting on events…

(PZ) #72

Good news - changed line 736 back to what you had before and now it works for whatever reason:

def aMap = [data: [lastupdt: lastupdt, shmtruedelay: false, motion: triggerDevice.displayName]]

Will keep you posted as I continue testing. - I’m not aware that you changed anything else, but the same code now works.

(Arn B) #73

@glog good work! You found the code regression that occurred in what was supposed to be a text only change to the setup screens that quickly followed the correction to the motion sensor error.:tired_face:

I retested the motion sensor logic issue and it is now operating as expected. Please update module SHM Delay Child from the Github Arnbme SHMDelay beta repository.

Why this causes a code crash. triggerDevice points to an event map that raised the alarm. triggerDevice.displayName has the name of the device and it is used for the SHM Delay intrusion message. triggerDevice.c does not exist causing a Groovy abnormal execution error. I suspect the c was introduced when I did a Ctrl/C to copy the displayName data for something, but instead of copying it changed the highlighted data to c.

(Arn B) #74

Page 2 Table of Contents

… Page 1 Table of Contents
16. Fix Motion Sensor Intrusion During Entry Delay
17. Fix Motion Sensor Intrusion During Exit Delay
18. Using Sounds and Text to Speach
19. Fix Siren Alarm During Entry delay
20. Using True Entry Delay
21. TrueNight Option, Keypads, and Exit/ Entry Delays
22. Way Beyond the Basics, User created SHM Modes
23. Using Simulated Keypad
24. Known Issues
25. Update History
26. Background
27. Source Code
28. Switching between “beta” and “Version2”

16. How to fix a motion sensor triggering an intrusion alert during the Entry Delay.

  1. In the contact sensor Delay Profile, select the triggering motion sensor, update the profile, then remove the motion sensor from the SHM Security: Armed Away Motion sensors. The motion sensor is 'followed", meaning it is ignored when the contact sensor is ‘open’ during entry delay and during exit delay, otherwise it is monitored during alarm state “away”.

  2. Multiple motion sensors may be set in a profile, by setting Global option “Allow Multiple Motion Sensors” to On/True.

  3. When a motion sensor is defined in multiple delay profiles, set Global option “Check other Delay Profiles” to On/True.

  4. If paragraph 1 thru 3 above does not correct the issue, set global option True Entry Delay to On/True.

:arrow_up_small: Back to top

17. How to fix a motion sensor triggering an intrusion alert during the Exit Delay when not using a Keypad

  1. In the contact sensor Delay Profile, select the triggering motion sensor, update the profile, then remove the motion sensor from the SHM Security: Armed Away Motion sensors. The motion sensor is 'followed", meaning it is ignored when the associated contact sensor is ‘open’ during entry delay and ignored during exit delay, otherwise it is monitored during alarm state “away”.

  2. Multiple motion sensors may be defined in a profile by setting Global option “Allow Multiple Motion Sensors” to On/True.

  3. When a motion sensor is defined in multiple delay profiles, set Global option “Check other Delay Profiles” to On/True.

  4. If paragraph 1 thru 3 above does not correct the issue, install **SHM Delay TrueExit then follow setup instructions

  5. Set AlarmState by using SHM Delay TrueExit monitored SHM Routine

  6. In this the SHM_Delay Profile: Set ExitDelay to 0

:arrow_up_small: Back to top

18. Sound and Text to Speech (TTS) announcements during a “True Exit Delay”

Most sounds and TTS announcements can be performed with Big Talker, RemindR, or your favorite app, with one exception: Exit Delay. For an announcement during a True Exit Delay:

:arrow_up_small: Back to top

19. How to fix a siren that goes off about 2 seconds into an entry delay and won’t stop

Your siren does not support the beep() command and is not working with the beep simulation commands. Remove the siren from the Delay Profile. It does not impact its use with SHM.
:arrow_up_small: Back to top

20. True Entry Delay Option (Default: False/Off)

This is a last resort when an intrusion alert continues after setting an optional followed motion sensor in a Delay Profile. How it functions:

  1. When a monitored contact opens in Alarm State Away, or Stay not using the instant true night option: the alarm state is set to Off
  2. Does nothing for user defined entry delay seconds, allowing time to turn off alarm (for real) by any method desired.
  3. When Alarm state remains unchanged (user did not set off again or did not rearm): Alarm System is rearmed to original state, then an intrusion is set by opening simulated contact sensor.

Note: this may cause confusion when viewing the system alarm state with phone app Dashboard, and unexpected SmartApp or Piston reactions.
:arrow_up_small: Back to top

21. TrueNight Option, Keypads, and Exit / Entry Delays

TrueNight (Default: Off / False) applies only to Iris 3405-L keypads and determines if the Partial Key creates an Instant or Delayed intrusion alert when a monitored contact sensor is triggered
Arm / Disarm: enter four(4) digit pin, followed by Off, On, or Partial

True Exit Entry Armed
Key Night Delay Delay State
On N/A Delay Delay Away
Partial Off Delay Delay Night
Partial On None Instant Night

When using a Centralite / Xfinity keypad in SmartThings Armed State: Night, the smartapp follows the ST Alarm state and lit Icon key
Arm: Press Stay, Away or Night icon; enter four(4) digit pin
Disarm: enter four(4) digit pin

Exit Entry Armed
Key Delay Delay State
Away Delay Delay Away
Stay Delay Delay Night
Night None Instant Night

Motion Sensor operation in Armed State:

  • Away: SHM Delay monitors all motion sensors defined in Delay Profiles, plus SHM monitors all motion sensors defined in “home is unoccupied”-> Motions sensors

  • Night: SHM monitors all sensors defined in “home is occupied”-> Motions sensors

:arrow_up_small: Back to top

22. Way Beyond The Basics, User created SHM Modes

User Defined Modes. Example: Create “Stay” mode for use with Centralite / Xfinity keypad

  1. In the IDE, My Locations, click the location, then create a new Mode “Stay”
  2. Then in the phone app “Routines”, create a new routine named: Stay (or whatever you want). Set AlarmState to Stay, and Mode to Stay. Add other settings as desired
  3. In Global Settings, scroll down to Keypad Routines, set the newly created Stay routine name for Stay/Partial.
  4. Implement ModeFix (Required)
  5. Update the SHMDelay Mode Fix profile Stay options to include ‘Stay’ as a valid mode along with Night.

The result:

  1. ActionTiles Mode and SmartHome Mode can display “Stay” and syncronize with Keypad
  2. BigTalker can speak the correct Mode change
  3. Webcore and other automations can test for Stay mode

:arrow_up_small: Back to top

23. Using Simulated Keypad

The Simulated Keypad creates an Iris or Xfinity/Centralite image in a browser or Android app that functions as a keypad with Smarthings using the SHM Delay smartapp. Should you want to try it in test mode without installing any code, the link is at https://www.arnb.org/keypad/www

Should you prefer running the keypad from an Android app, it may be downloaded at https://www.arnb.org/keypad/keypad.apk You must allow Andoid to install apps from “Unknown Sources”. The app was generated using Phonegap. An IOS app is likely not going to be released due to the need to spend at minimum $100 to simply create the app.

What could this be used for?

  • Giving access to your Smarthings system to a spouse, friend, child, dog walker, neighbor, sitter, etc without having to install the Smarthings App or any other software on their phone, Each user has a unique pin, that may include date and time restrictions.

  • Try out and setup your system with a “Simulated Keypad” before making the decision to purchase and install a real keypad.

How to Install assuming you are already using SHM Delay.

  1. Install all SHM Delay modules from the Github ARNBME SHMdelay Version2 branch. You may do this with the IDE or manually by going to https://github.com/arnbme/SHMDelay/tree/Version2/smartapps/arnbme then copy the modules and install 'from code". Install the new module SHM Delay Simkypd Child, Save do not publish, then authorize this module for Oauth in the IDE.

  2. In the IDE, 'My Device Handlers", add device “Internet Keypad” Install using “Update From Repo” from the Github ARNBME SHMdelay Version2 branch. You may do this with the IDE or manually by going to https://github.com/arnbme/SHMDelay/tree/Version2/devicetypes/arnbme/internet-keypad.src then copy the Raw module, then paste using “Create a New Device Handler” and installing “from code”.

  3. Create one or more virtual keypad devices. In the IDE go to “My Devices”, click “New Device” set the parameterrs, and set the type to “Internet Keypad”

  4. On your phoneapp, go to Automation->Smartapps, then tap SHM Delay. Scroll down and tap “Global Settings” Set “Activate Total Keypad Control” to ON/True. Save the profile

  5. On your phoneapp, go to Automation->Smartapps, then tap SHM Delay. Scroll down and tap “Create A New Sim Keypad Profile” Set a simulated keypad device, then save the profile. Go back and tap on the newly created profile, it displays an 8 character ID, copy it, then go to https://www.arnb.org/keypad/www enter and save the ID. The simulated keypad is now live including the panic key on the Iris image.


  • May require one arm/disarm for status to show
  • Status display does not work with IE or Edge Browser
  • Status display may be delayed by up to 3 seconds

:arrow_up_small: Back to top

24. Known issues

  • When switching into page 2 of the documentation from page 1, browser does not go directly to desired html anchor point.

  • Occasional strange system operation when creating a user profile. Ignores all input data or forces reentry of a field.

:arrow_up_small: Back to top

25. Update History

Jun 15, 2018 current Beta logic installed into Version2, including:

  • Simulated Keypad
  • User pin restrictions by SHM Mode or keypad device
  • Version verification

Jun 05, 2018 Documented Simulated Keypad (Beta)

Apr 30, 2018 Updated modules SHM Delay(2.0.4), SHM Delay Child(2.0.1), SHM Delay Modefix(0.1.2), SHM Delay Users(0.0.1)

  • Anyone using an Xfinity or Centralite keypad (should not impact Iris or non keypad users)
    In Modefix profile new settings. You may set the Icon button to light on the keypad, Stay (Entry Delay) or Night (Instant Intrusion) when arming from a non keypad device suchas dashboard or ActionTiles. Note this field displays only when an Xfinity or Centralite keypad is set in globals
  • Anyone who has the same motion sensor defined in two or more Delay Profiles
    Issue: False alarm from motion sensor when a contact sensor opens, the other profile created an intrusion from the motion sensor. Set Global option “Check other Delay Profiles” to On/True.
  • Issue: Real contact sensor not accepted when text “simulated” in type data
  • Add dynamic version numbers to all modules. May be used in future to verify user’s system is current

Apr 04, 2018 Beta Version 2.0.1 Released, Updated module SHM Delay

  • Fix issue with burned pin
  • Move all documentation to community forum release thread
  • Change global keypad selection from capability to device

Mar 14, 2018

  • Beta Version 2 Released

:arrow_up_small: Back to top

26. Background

I developed this app after I was presented with a steep learning opportunity created by installing Smartthings, an Xfinity keypad and GoControl siren. I purchased the keypad because ST phone presence proved unreliable as a SHM control method.

After installing the Xfinity 3400-X keypad and GoControl siren I made the decision to continue using SHM instead of SmartAlarm (no longer supported) because in theory, SHM is supposed to run on the local hub. I thought that would give me more reliability during an internet outage. That is likley not true but anyhow I’m using SHM. SHM lacks an: EntryDelay time, ExitDelay time, keypad support, and Zones.

This app does not support Zones, but does have a unique profile for each monitored sensor, allowing for unique entry and delay times, which keypards sound tones, and which sirens to beep.

Before writing this app I developed the logic using multiple Core and WebCore pistons for EntryDelay, and Open Door Monitoring. I’m a (PHP, Javascript, IBM Assembler, Cobol, Database) programmer, and wanted finer control over the processing. I taught myself Groovy and created some apps for personal use, then added editing, and released it to the ST Community. I found Java/Groovy similar to PHP and Javascript, but bumped into many frustrating differences. That said I hope someone, especially Noobs, find this app useful.

:arrow_up_small: Back to top

27. Source Code

:arrow_up_small: Back to top

28. Switching between “beta” and “Version2”

If you are running “beta” or “Version2” and you want to swap versions.

  • There are four (4) modules associated with the app:
  1. SHM Delay. Module should be Saved, Published, then Installed with the Smarthings app (must be done first)
  2. SHM Delay Child. Should be Saved, do not publish or install.
  3. SHM Delay ModeFix Should be Saved, do not publish or install
  4. SHM Delay User Should be Saved, do not publish or install.
  • Installing via the repository (preferred)
  1. Go the the IDE–>Login–>My Smartapps–>Settings–>change Github respository
    Owner: arnbme (in upper case that is ARNBME)
    Name: SHMDelay
    Branch: (beta / Version2) --> when “beta”, enter “Version2”; when “Version2” enter “beta”

  2. Click ‘Save’

  3. In “My SmartApps”

    • For SHM Delay, SHM Delay Child, SHM Delay ModeFix, and SHM Delay User
    • Click “Edit Properties” --> Click “Source Code Options” --> Select the Repo libary you just changed --> click “Update” on bottom of page
  4. In ‘My SmartApps’ click 'Update from Repo". Follows steps 5 and 6 when modules are out of sync.

  5. Select the SHMDelay repository you just changed, then install and publish SHM_Delay (must be first)

  6. Install do not publish SHM_Delay Child, SHM_Delay ModeFix, SHM Delay User

  7. (If not previously done) In the ST Phone APP install the SHM_Delay app

:arrow_up_small: Back to top

(Arn B) #75

As part of transitioning Version 2 to live status the application documention in this thread now includes a “Table of Contents”. Due to size limitations with the community forum, the documentation is currently split into two postings that work with each other. In the future the documentation may move to another site.

All documentation was removed from the SmartApp, and an external link was added pointing to the community forum docmentation.

Please update module SHM Delay to Version 2.0.1

  • Documentation Removed from smartapp
  • Fix issue with “Burned Pins”
  • Keypad selection now done by device rather than capability

(Paul James) #76

I have not seen a way. Is there a way to set a longer delay for a specific contact. I have the delay set up on the back door but we have a garage that is away from the house. I think it will take longer then 90 seconds from when I set the alarm go out the back door, into the garage, open the garage door and back out of the garage then close the garage.


(Arn B) #77

In the IDE Smartapps
Using a keypad change SHM Delay line 171 from

0..90 to 0..120

or however many seconds you need

In SHM Delay Child same on lined
392 396 402

(Paul James) #78

Thank you will give that a try.

(Arn B) #79

SHM Version 2 is released as of April 8, 2018.

Thank you to everyone who participated and assisted with the SHM Delay beta testing.

How does this impact me?

If SHM Delay is installed from Github arnbme SHMDelay beta, you should change to the newly created Version2 branch which will always have the latest stable release of SHM Delay.

Instructions for changing the Github branch are at this link.

As of April 8, 2018, Version2 was an exact copy of the beta branch.

(Paul James) #80

I am not sure if I have something set up incorrectly. Everything seems to be working as I understand it to be working with the following exception. I currently had the routine “I’m Back” to switch on when one of the presence sensors arrives home. I thought this would then deactivate the alarm but it does not seem to be changing it to disarmed or changing the keypad to disarmed.

I am running version 2.0.1 and using Life360 as a presence sensor. I can see the person change to present.


(Arn B) #81

I have no experience with Life360, but can suggest a few things to help track this down.

  1. When the system is armed and “I’m Back!” is executed from the Phone App, does the system disarm?
  2. When this issue occurs does the Notification log show I’m Back being executed?

Should this not help, please get back to me with your normal method of arming and disarming the ST system.

Edit: If Modefix is not set on/true in the globals, set it on/true then set the Modefix profile settings


Hi, I’m very glad I found this, but I could use some help to completely commit to this app.

I’m using an IRIS keypad and I prefer to use Lock-Manager to handle this keypad (this allows me to set 1 pin, and use the “off”, “partial”, and “on” buttons to disarm, arm-night, or arm-away)

Everything seems to work well with the exception of timing.

I have the app configured to “beep” the keypad during an entry delay.

My first problem is that the reaction to my “real” entry sensor is delayed. If I open the door for 2 seconds, then immediately close it, the system does not do anything. If I open the door, and hold it open for ~8-10 seconds, then the system behaves correctly, keypad beeps during the delay, and the system triggers an actual intrusion alert.

My second problem is when setting the “True Night Flag”. This doesn’t seem to work at all, I have SHM set to Arm (Home), and I still get a delay, which ultimately does lead to an actual SHM intrusion alert.

Any suggestions? Do I have to use specific names for the modes? Also, I only have three modes, “Away” - SMH Armed(away), “Home” - SMH Disarmed, and “Night” - SMH Armed(stay)

(Arn B) #83

I have not tested the Lock Manager (any version) with SHM Delay Version 2. Should both apps be attempting to manage the keypad, results are unpredictable.

SHM Delay V2 has full support for Iris keypads including user pins, the panic key, and more. Should you have questions about using SHM Delay V2 as a stand alone manager for the keypad, l can help.


I’ve tried to use the keypad function in SHM Delay Version 2, but I can’t seem to figure out how to use the keypad.

I get that each PIN can be associated with a user or routine.

If I have a 4 digit PIN, I enter the PIN on the keypad. After I enter in all the digits, is there an “enter” button I have to press to “send” the pin in for execution?

(Arn B) #85

Should the keypad not react using only SHM Delay V2, go into global settings, set “Activate Total Keypad Control” On/True, setup the keypad(s). Also suggest setting ModeFix on/true, then setting up the Modefix Profile.

Please go to the top of this thread then click on Converting From Version 1, click on the link, then scroll down to “Prepare smartapp for use” and follow all directions to insure SHM has full keypad control.


Looks like I got the keypad working by completely uninstalling lock-manager.

The function for “true night flag” still does not work correctly. It still introduces a delay and does not immediately trigger SHM.

Do I have to use the specific default smartthings routine names such as “Goodbye!” and “I’m back!”? Also, is the name of my modes important as well?

(Arn B) #87

That is correct and is covered in the conversion instructions from Version 1

When processing with a cloud based system such as SmartThings, where all user defined device handlers and SmartApps run in the cloud, a delay of a few seconds and sometimes more is not unusual. Should it trigger a delay where the keypad sounds entry tones, please let me know.

User defined routines are supported, however selected routines must set the appropriate SHM mode and alarm state for the keypad alarm setting. Example: Iris On: SHM = Armed Away

User defined modes are supported. Global Modefix must be set on/true along with setting the Modefix Profile

(Rishi) #88

Is there a way to have my door beep go over during the entry/exit delay? Ex. if I have it set for 30 second delay, i want the door chime (piezo buzzer) to beep for the 30 seconds before siren going off. It does not recognize the buzzer in the settings for beep. I only can see the siren but it chirps only once.

I also updated to version 2 and the app in SmartThings still says 2.0.1 Beta, is that correct?