Version 2.0 now available
Please try out the easier to use Version2.
Purpose
This smartapp simulates the Entry and Exit Delay parameters currently missing in Smart Home Monitor (SHM), allowing for some time on entry to disarm the system, and time to exit the facility without triggering an alarm.
Entry and Exit delays operate on contact sensors selected in Delay Profiles. SHM is generally fully armed while using this smartapp, tripping a ‘non-delayed sensor’ immediately triggers a SHM intrusion alert. This means a motion sensor that ‘sees’ a door with a delayed sensor, or ‘sees’ a arming/disarming device such as a keypad, may trigger an intrusion alert while you are arming/disarming the system. Motion sensor issues may be mitigated by specifying the motion sensors in the Delay Profile.
All sensors defined in Delay Profiles must be removed from SHM Security monitoring. A single Simulated Contact Sensor device must be added to the SmartThings IDE, and monitored by SHM Security.
Should there be issues causing unexpected intrusion alerts, there is an add-on smartapp for exit issues, and a global option for complex entry delay issues. Both options are defined later in the documentation.
Support this project
This app is free. Donations are appreciated.
- Paypal: https://www.paypal.me/arnbme
Features
- Supports multiple real contact sensor profiles, that may include an optional ‘followed’ motion sensors
- Each profile supports sounding EntryDelay tones on Keypads(Optional)
- Each profile supports sounding Beep tones on Sirens (Optional)
- For monitored contact sensors: Replaces SHM’s messaging when the system is armed with an open contact. These messages may be: logged, sent by notification, sent by SMS to one or more phones. The app also supports the hidden "SmartThings Contact List" feature when it is activated.
- Optionally issue intrusion messages with the name of the real open door sensor. Suggested when using non-unique simulated sensors. This message may optionally include a 3 digit emergency number and one or more emergency phone numbers.
- Lock Manager Keypad Replacement module smoothes out keypad operations (Optional)
- True Night Mode - Choose if Stay / Night mode has an entry delay or immediate alarm (Optional)
- Mode Fix - Fix Mode when setting alarm state from the SmartThings Dashboard Home Solutions (Optional)
- Way Beyond the Basics - full use of the Xfinity and Centralite keypad’s three Modes: Stay, Away and Night (Optional)
- This module can and will be deprecated when SHM includes Entry and Exit delay parameters
Entry Delay example:
The system is armed, a monitored sensor opens, let’s call it "The Front Door’, the app waits for the specified number of seconds while optional sirens and keypads sound tones or beeps. When the system remains armed, the paired simulated sensor is opened, triggering an intrusion alarm.
Exit Delay example:
You arm the system. You may then open and close the monitored sensor as many as necessary during the Exit Delay time period.
Arming with an Open Sensor Monitor example:
You arm the system but the sensor on the monitored Back Door is open. After 1 minute in this state, a warning notification is issued. Additional warnings can be issued based upon your settings.
Quick Setup Guide
- Install: follow directions in “Installation” paragraph below
- In SmartThings phone app, add SmartApp SHM_Delay (install it later)
- In the IDE Devices create one simulated contact sensor device. Later this device is added to SHM Security “contact sensors to use”
- In this app, SHM_Delay, view the “Global Application Settings”. Suggest keeping all the defaults, but define your 3 digit emergency and local police department telephone numbers, then click “Done”. The app is now installed,but does nothing until a Delay Profile is created
- Create one or more Delay Profiles
- Adjust SHM Security monitored contact sensors, exclude real sensors used in step 5 above, and include simulated sensor(s) defined in step 3.
- If using a keypad verify your settings
- Test your system in Away, and Stay/Night modes for correct operation.
Stop here! When ready, add one or more of the following features documented below. - Install the Lock-Manager Keypad replacement module (all keypad users only)
- In Global Settings Implement “True Night Mode” (all users)
- in Global Settings Implement “Mode Fix” and create Mode Fix settings(all users)
- Way Beyond the Basics (Xfinity and Centralite keypad users only. Not for Iris users) Utilize all available armed keypad modes: Stay, Away, and Night
Installation
There are three modules associated with the app:
- SHM Delay. Module should be Saved, Published, then Installed with the Smarthings app (must be done first)
- SHM Delay Child. Should be Saved, do not publish or Install.
- SHM Delay ModeFix Should be Saved, do not publish or install
There are three ways to Install:
- Install via the repository, add the following to the IDE Settings.
Owner: arnbme (in upper case that is ARNBME)
Name: SHMDelay
Branch: Master
- Click ‘Save’, then in ‘My Smart Apps’ click 'Update from repo",
- select the SHMDelay repository and install and publish SHM_Delay (must be first)
- install do not publish SHM_Delay Child and SHM_Delay ModeFix
- In the Phone APP install the SHM_Delay app then follow the provided directions.
Using a UK hub or device? See this thread to enable Github
-
Manually install by going to https://github.com/arnbme/SHMDelay/tree/master/smartapps/arnbme then copy the modules and installing 'from code" You may also copy the source from the code links below.
Creating a Simulated Contact Sensor
Each monitored contact sensor must be paired with a “simulated contact sensor” device. A single simulated sensor may be used with multple real devices, or it may be unique. Instructions for creating a simulated contact sensor device with the IDE are included within the app.The simulated sensor(s) must be monitored by SHM.
You may use the directions in this thread, but you must change the following:
- Login to the IDE @ https://account.smartthings.com/
- create device “Simulated Contact Sensor”
Setting SHM Security for use with this app
In Both: Sensors When home is unoccupied, and When home is occupied
- Use every open/close sensor: off/false
- Open/Closed Sensors: exclude Real Sensors monitored by this app, include Simulated contact sensor used by this app; include other real contact sensors not monitored by this app, and be sure to exclude all keypads that show up as a sensors
- Motion sensors unoccupied mode (Away): When an optional motion sensor is defined in a Delay Profile remove it from SHM Security monitoring
- Motion sensors for occupied mode (Stay/Night) Exclude motions sensors where you would normally move around at during the night or while you are at home. If you don’t know, set no motion sensors in this mode.
Initial Testing using the SmartThings phone app
There is a bug in SHM. When an intrusion alert is not cleared in the phone app, the next intrusion will send a notification, but will not execute any Security automations such as sirens or lighting. This is generally only an issue during system testing.
Work Around: clear intrusion alerts as they occur.
Test the simulated sensor
- Tap Dashboard
- Tap Armed Away
- Tap My Home
- Scroll to the simulated contact sensor device. It should show “closed”, if not tap it once to close it. Tap to open it.
- Alarm should trigger. Clear alarm by tapping Disarm, clear intrusion in phone app, continue with Exit Delay test.
No Alarm: Verify SHM Security is monitoring the simulated contact sensor.
Test Exit Delay You may skip this test when an Exit Delay is coded in the Lock Manager Keypad module
- In the SHMDelay Profile set entry delay to 0, set exit delay to 30 seconds (save it)
- Close the door associated with the real contact sensor
- Tap Dashboard in phone app
- Tap Armed Away. Allow system to arm.
- Open the door -->Alarm should not trigger
- Close the door
- Wait “exit delay” seconds
- Open the door–>Alarm should trigger Clear alarm by tapping Disarm, clear intrusion in phone app, continue with Entry Delay test.
Alarm issued at Step 5:
- Verify an exit delay is coded on the Delay Profile
- If the exit delay expired opening the door, retry.
- Verify the real contact sensor is not monitored in SHM Security.
- When a single motion sensor caused the alarm: add the motion sensor to the Delay Profile, remove from SHM Security
- When multiple motion sensors caused the alarm: set Global option “Allow Multiple Motion Sensors” to On/True, add sensors to Delay Profile, remove from SHM Security.
- When non motion sensor device created the alarm: install and configure SHM Delay TrueExit
No Alarm: Verify the contact’s SHM_Delay sensor profile info; save it, then save again on main page, retry
Test Entry Delay
- In the SHMDelay Profile set exit delay to 0, set entry delay to 30 seconds
- Close the door associated with the real contact sensor
- Tap Dashboard in phone app
- Tap Armed Away. Allow system to arm.
- Open the door -->Alarm should not trigger
- Wait “entry delay” seconds–>Alarm should trigger
Alarm issued at Step 5:
- Verify an entry delay is coded on the Delay Profile
- Verify the real contact sensor is not monitored in SHM Security.
- When a single motion sensor caused the alarm: add the motion sensor to the Delay Profile, remove from SHM Security
- When multiple motion sensors caused the alarm: set Global option “Allow Multiple Motion Sensors” to On/True, add sensors to Delay Profile, remove from SHM Security.
- When a non motion sensor caused the alarm, global option “True Entry Delay” option must be used.
No Alarm in Step 6: Verify the contact SHM_Delay sensor profile info; save it then, save again on main page, retry
Test Completed
- Clear intrusion alert in phone app
- In the SHMDelay Profile set exit delay and entry delay to desired values, then save.
How to fix a motion sensor triggering an intrusion alert during the Entry Delay.
-
In the contact sensor Delay Profile, select the triggering motion sensor, update the profile, then remove the motion sensor from the SHM Armed Away Motion sensors. The motion sensor is 'followed", meaning it is ignored when the contact sensor is ‘open’, otherwise it functions normally.
-
Multiple motion sensors may be set in a profile, by setting Global option “Allow Multiple Motion Sensors” to On/True. However, using True Entry Delay may be a better option.
-
If paragraph 1 or 2 above does not correct the issue, set global option True Entry Delay to On/True.
How to use this app with @ethayer Lock Manager
Notice: This app was developed and tested using Version 1 or the Lock Manager, and has not been tested with Version 2
.
Keypads (Installed indoors) Verify the keypad is operating normally before using it with the SHM Delay app!
Lock Manager settings
- Global Settings --> Keypad Routines suggested: Away: Goodbye, Disarm: I’m Back, Stay and Night: Good Night
Selected routines must have a “Set Smart Home Monitor to” coded, and a “change the mode to” coded or the keypad will malfunction. - On each Keypad Settings profile: Act as SHM device must be set On/True; Routines: Empty;
Arm Delay: seconds 15 to 90. This is the Exit Delay and sounds exit tones when arming from the keypad. While this delay is active SHM is not armed - On each User: Set 4 digit pin code; Routines: Empty
- Keypad smartapp executes all coded routines. Coding routines for keypads and users creates excessive system overhead
SHM Delay Sensor Profile settings:
- Entry Delay: something greater than zero.
- Exit Delay: zero (0)
- Set keypads to sound entry delay tones
Smart Door Locks and outdoor Keypads
When unlocking with smart door lock or entering a pin on an outdoor keypad with a contact sensor on the door, and the contact sensor reports an intrusion before the system sets the Alarm Status to off:
- set exit delay to 0
- set entry delay to > 0
How to fix a motion sensor triggering an intrusion alert during the Exit Delay when not using Lock Manager
-
In the contact sensor Delay Profile, select the triggering motion sensor, update the profile, then remove the motion sensor from the SHM Armed Away Motion sensors. The motion sensor is 'followed", meaning it is ignored when the associated contact sensor is ‘open’ on entry delay and ignored during exit delay, otherwise it functions normally.
-
Multiple motion sensors may be defined in a profile by setting Global option “Allow Multiple Motion Sensors” to On/True.
-
If paragraph 1 or 2 above does not correct the issue, install **SHM Delay TrueExit then follow setup instructions
-
Set AlarmState by using SHM Delay TrueExit monitored SHM Routine
-
In this the SHM_Delay Profile: Set ExitDelay to 0
Xfinity/Iris/Centralite Keypad TroubleShooting
Before proceeding please insure your keypad is properly installed on Smarthings by reviewing the
- Centralite PDF information
- Iris Information
- Xfinity try both of the above procedures.
- and the directions at this link
This app was developed and tested with the DTH at miriad/Centralite-Keypad/master, or you may get it at this link: https://raw.githubusercontent.com/miriad/Centralite-Keypad/master/devicetypes/mitchpond/centralite-keypad.src/centralite-keypad.groovy
Other DTHs may function, but may not produce entry or exit tones. The DTH should look like the following image: For Centralite manufactured keypads only. UEI and TCH keypads not supported by this DTH
- No entry or exit tones sounding:
Press and hold the 8 button until you get a confirmation beep to toggle the chime on or off.
On the keypad press and hold the 2 key to raise the volume until you hear a tone, press 5 to lower the volume.
Then in the ST phone app go to My Home, select the keypad, then tap on settings. Set length of beep to 10, save it, then press the ‘Sound’ icon. You should hear tones.
If you hear tones continue on
- Still no entry tone when door is opened. Make sure you are beyond the exit delay time, the keypad is selected in the real sensor’s Delay profile, and entry delay is greater than 0.
- Still no exit tone: Make sure the lock manager exit delay time is greater than 0
More information Note: Some information is specific to using an Xfinity keypad on an Xfinity system.
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:
- Using a Keypad: SmartApp Keypad_ExitDelay_Talker
- No Keypad: SHM_Delay_TrueExit
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.
Keypad module replacement (Default: False/Off)
This is a forked version of E Thayer’s Lock Manager Keypad module. I urge everyone with keypads (not locks) running with Lock Manager to install this module, however there is a prerequisite, so please read the documentation and follow the instructions. Source code is at repo arnbme lock-manager SHMDelay or directly at https://github.com/arnbme/lock-manager/tree/SHMDelay/smartapps/ethayer
The changes are:
- Comment out sendSHMEvent. Kills setting default AlarmState before running user routines that also set the AlarmState and Mode. One of those AlarmStates is ‘Night’ which is not recognized by ST and my code.
- When AlarmState is ‘Stay’ and Mode is ‘Night’ turns on the Keypad ‘Sleep/Night’ icon, otherwise lights the ‘Stay/Standing Man’ icon
- Issue ExitDelay only in AlarmState: Away. Original issues exitDelay when night icon is used
- When ExitDelay is zero, eliminate use of Groovy runIn command improving reliabilty and performance. (Sep 18, 2017)
Prerequisite: Prior to installing this version in Lock Manager you must define SHM Routines by going to
-
Automation->SmartApps->Lock Manager
-
Scroll down to Keypad Routines. These routines run for all defined keypads and users when a keypad AlarmState and valid pincode is entered, setting the SHM AlarmState.
Arm/Away : Goodbye
Disarm: I’m Back
Arm/Stay: Good Night
Arm/Night: Good Night -
Review all Keypad and User profiles: Remove redundant routines defined in KeyPad Routines to substantially reduce system overhead and improve reliability.
-
Should you decide to use the “Way Beyond The Basics” we will revisit the Arm/Stay setting
-
Note: when using custom routines for Keypads or Users, and you choose not to set default global Keypad Routines, insure a routine that sets both Alarm State and Mode executes for each of the four keypad modes.
To install with the SmartThings IDE go to SmartApps:
- Click '‘Settings’ → Add new repository → enter: arnbme lock-manager SHMDelay->Save
- Click the edit icon to the left of the Keypad module name
- Click ‘Source Code Options’ change to lock-manager (SHMDelay)->click Update on bottom of page
- Click ‘Update From Repo’ → select lock-manager (SHMDelay)
- Select ‘Keypad’->leave ‘publish’ unchecked-> click ‘Execute Update’
- When 4 and 5 fail to update, click the magnifying glass icon , the source for the updated module and the current version display, then click ‘Overwrite local version’, then click ‘Save’ completing the install.
- In Global Application Settings set ‘upgraded Keypad module is installed’ to On/True
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:
- 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
- Does nothing for user defined entry delay seconds, allowing time to turn off alarm (for real) by any method desired.
- 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.
True Night Mode Option (Default: False/Off)
This option when On causes an immediate intrusion in AlarmState: Stay. When Off (default) the profile entry delay time is used. (A keypad is not required for this option)
Additionally, when using the Keypad module replacement with keypad, in Night mode the app lights the ‘Night’ icon on with Xfinity and Centralite keypads. When arming with True Night Mode, the ‘Stay’ icon may light for a few seconds, then it shuts off and the “Night’ icon lights. Iris keypads have a single a ‘Partial’ button and I don’t have one available for light testing, however the Night no entrydelay should work.
Mode Fix Option (Default: False/Off)
Sets the SHM Mode when setting the AlarmState from the SmartThings Dashboard Home Solutions or anything that does not properly set the Mode. It’s needed for “Way beyond the basics”, but you may find it useful on its own.
Activation requires two steps:
- In Global Application Settings set the Fix Mode option on/true
- Create A ModeFix Profile (default profile initially shows in the child app)
Have you ever wondered why Mode restricted Routines, SmartApps, and Pistons sometimes fail to execute, or execute when they should not? I gave up trying to use mode for Core Pistons, now I know why it did not work.
Perhaps like me you conflated AlarmState and Mode, however they are separate and independent SmartThings settings. When Alarm State is changed using the SmartThings Dashboard Home Solutions, or Lock Manager Keypad without any defined routines—surprise, Mode does not change!
SHM routines generally, but not always, have a defined SystemAlarm and Mode setting. Experienced SmartThings users seem to favor changing the AlarmState using SHM routines, avoiding use of the Dashboard’s Home Solutions.
If like me, you can’t keep track of all this, or use the Dashboard for changing the AlarmState, the Mode Fix option may be helpful. For each AlarmState, set the Valid Mode states, and a Default Mode. Mode Fix attempts to correctly set the Mode by monitoring AlarmState for changes. When the current Mode is not defined as a Valid Mode for the new AlarmState, the app sets Mode to the respective state’s Default Mode.
Please Note: This option does not, directly or (knowingly) indirectly, execute a SHM Routine
Way beyond the basics (Default: False/Off)
For Xfinity and Centralite Keypads – now you can have fully functional Stay and Night icons and modes. (Not for use with Iris Keypads)
- Install my version of E Thayer’s Lock Manager Keypad routine, then in Global Application Settings set the Upgraded Keypad flag to On/True the (see above)
- Turn on True Night Mode in Global Application Settings
- Implement Mode Fix if there is the slightest chance you will set the AlarmState with the SmartThings - Dashboard Home or something that does not set Mode.
- In the IDE, My Locations, click the location, then create a new Mode “Stay”
- 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
- In the Lock Manager, scroll down to Keypad Routines, set the newly created Stay routine name for Armed/Home.
- Update the SHMDelay Mode Fix profile Stay options to include ‘Stay’ as a valid mode along with Night.
The payoff for all your work is a fully functional Xfinity / Centralite keypad and SHM Alarm System with almost instananeous response (when the SmartThings cloud and internet cooperate), and full use of the keypad’s three armed states.They are:
- Home/Stay: No Exit Delay; User defined Entry Delay
- Away: User defined Exit Delay, User defined Entry Delay
- Night: No Exit Delay, No Entry Delay (Instant intrusion alert when you are sleeping!)
Update History
Feb 04, 2018
- Correct no intrusion alert when EntryDelay is 0
Jan 08, 2018
- Eliminate unused code in doorOpensHandler that wasted cycles
Jan 06, 2018
- Allow motion sensors to have a short delay. Durring entry sometimes a motion sensor “sees” a door, triggering an alarm before the door contact sensor registers as open in SHM. Added optional motion sensor delay field in profile allowing from 0 to 10 seconds for the contact sensor to register as open. Should this field be needed, suggest starting with 5 seconds.
- Allow user to optionally override simulated sensor error by entering 4 to 8 characters from IDE Name field into Delay Profile override field
- Fix logic for sirens without beep command, Should correct issue where siren does not shut off at 2 seconds into an entry delay
- Allow RG Linear and Nortek devices as real.
- Simplify and slim down the error logic code
Dec 31, 2017
Global option “Allow Multiple Motion Sensors” added. Set to on/true to define multiple motions sensors in a Delay Profile. Default: Off/False
Maximum Exit and Entry delay times increased to 90 seconds from 60 seconds
Existing Delay Profiles continue functioning without any changes
Dec 20, 2017 Away Mode false alarm during Exit Delay.
A followed motion sensor is defined, during away mode a door (contact sensor) was not open, then motion sensor was activated during exit delay time frame, triggering an alarm.
Dec 02, 2017 Away Mode false alarm during Entry Delay.
A followed motion sensor is defined and during away mode: you open a door starting entry delay time, walk in, then close the door, trigger the followed motion sensor prior to disarming, creating a false intrusion alert. Updated logic correcting the issue.
Nov 16, 2017 added support sending messages using the ST Contact List, and append the IDE Locaton name on all messages. When messaging with Contacts, there is a SmartThings bug that always logs to notifications. Set the Profile “Log to Notifications” setting to off/false, avoiding double notifications. Click here for instuctions to enable the Contact List.
Oct 04, 2017 Corrected an issue with IRIS keypads: when arming in “Partial” mode from the keypad the “Partial” button did not light. Updated modules SHMDelay Child and my version of Keypad
Sep 26, 2017 Documentation updated reflecting support for handling motion sensors and other devices triggering an alarm during the entry delay time.
- Optional ‘Followed’ Motion Sensor in Monitored Contact Sensor Profile. Meaning: In alarm state Away, when the monitored contact sensor opens, this motion sensor is ignored, otherwise It reacts normally.
- ‘True EntryDelay Mode’ when this option is true, and monitored contact opens, all other system sensors are ignored for EntryDelay seconds.
Sep 13, 2017 Documentation updated reflecting the release of SHM Delay TrueExit Smartapp. There are no changes to the SHM_Delay App
Sep 06, 2017 Documentation Updated to reflect release of the stand alone version ModeFix smartapp that norrmally executes as a child module as part of this app.
Sep 5, 2017 Documentation was updated for release V1.2.0
Aug 18, 2017 Initial Release
Caveat Emptor
All community supported SmartApps, community device handlers, and Smartthings supported simulated contact sensors, run on the Smartthings cloud, not your local Hub. This means when the Smarthings server is down, or your internet connection is down, or your WiFi router is down, this app along with every other installed community supported app, and all cloud devices, do not function. During an outage if you are using SHM and your system is armed, locally supported devices monitored by SHM should trigger an alarm, and locally supported sirens should sound, you just won’t be able to turn off the siren. Also, you will probably not receive SmarthHome’s intrusion messages, and you can forget about arming or disarming your system with your phone app. Hopefully this is a rare occurrance.
There is a bug in SHM when an intrusion alert is not cleared in the phone app. The next intusion will send a notification, but will not execute any Security automations such as sirens or lighting. This is generally only an issue during system testing.
Work Around: clear intrusion alerts as they occur.
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.
On my system EntryDelay and door Monitoring are handled by my app. ExitDelay and keypads are handled by the Lock Manager app, but ExitDelay also available in this app should you not be using the Lock Manager. 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.