Hi all,
Attached is a script that manages actions associated with z-wave locks opening, closing, etc. I originally wrote it to replace a HS2 script by rmasonjr that created logs and virtual devices that showed who had unlocked doors. I recently converted it to work with HS3. However, afterwards I realized I could use it to eliminate a bunch of my HS2 events that I still had to implement on HS3 but kept putting off due to the tedious nature of those events. For each lock, I used to have approximately 15 events or so. This one script replaces all of those, so for 3 locks, that means I now only have 3 events, rather than 45
.
The discussion thread for this script is here: http://board.homeseer.com/showthread.php?t=174916
The script can do the following:
This script should work for any kind of lock that has a notification device.
I call the script using the following event (one for each lock):

This is based on changes to the lock's notification child device. The script requires 1 parameter to be passed to it which is the door/lock name.
The attached zip file contains 2 files:
Important Note: You must modify your settings.ini file in the \Config folder for the script to work by adding the following setting to the ScriptingReferences= line under the [settings] section while HS is shut down. Adjust the path to System.Data.SQLite.dll as per your own system and only include the trailing comma if you have other scripting references after this one.
If you don't have a ScriptingReferences line in your settings.ini file already, then add as follows right below the [settings] header:
again adjusting the path to System.Data.SQLite.dll as per your own system.
How the script behaves can be configured using the provided web page (doorlock.aspx) and the configuration parameters are stored in an INI file called doorlock.ini in the \Config subfolder. The INI file can also be manually updated if you wish. A default INI file is created when you first run the script or web page. When the web page (doorlock.aspx) is first loaded, it shows the General Settings:

Once you add a lock by entering a name for it in the Locks field and clicking Submit, you are taken to the main configuration parameters for the lock where you enter the Reference ID for the lock's notification device and the Reference ID for the device where you want to log the latest lock events to:

Once you have entered those and clicked on Submit, the web page queries all the possible Value-Status pairs from the lock's notification device and displays them on the screen. Each one can now be configured as needed for notifications and announcements:

Cheers
Al
Changelog:
3.x Original versions
4.0 Internal version for testing
5.x Test versions using database
6.0 Now uses a database, all config options are moved to an INI File, and a Web Page for configuration is now included.
6.1.1 Minor bug fix, improved debug logging and will use status-value pair for message if no specific message has been defined.
6.2 Minor bug fixes, moved Pushover function to main script, easier config of Pushover settings. Now has option to create the logging device from the config page, and will try to determine the lock's notification device reference id.
6.4 Added support for special tags in the Action Message and uses correct paths for Windows & linux.
6.7 Added support for the Random plugin and also for sending notifications to the Jon00RCCNM client.
6.9 Added support for linux (thanks to Igorski88 for all the testing!)
6.95 Updated to support the additional Pushover Parameter.
NOTE: The separator character in the INI file was changed from , to | in version 6.4. If you are upgrading from a 6.0-6.3 version, then you MUST open doorlock.aspx and look at the settings for each of your locks. Doing so updates the INI file to the new separator. If you are going straight from 3.x, 4.x, 5.x to 6.4 or newer, then this does not affect you.
Attached is a script that manages actions associated with z-wave locks opening, closing, etc. I originally wrote it to replace a HS2 script by rmasonjr that created logs and virtual devices that showed who had unlocked doors. I recently converted it to work with HS3. However, afterwards I realized I could use it to eliminate a bunch of my HS2 events that I still had to implement on HS3 but kept putting off due to the tedious nature of those events. For each lock, I used to have approximately 15 events or so. This one script replaces all of those, so for 3 locks, that means I now only have 3 events, rather than 45

The discussion thread for this script is here: http://board.homeseer.com/showthread.php?t=174916
The script can do the following:
- Create and update a database in the \Data\Locks directory which contains activity info from the z-wave lock. If the directory does not exist it will be created by the script.
- Speak who has unlocked a lock. If you use Jeff Farmer's very cool Random plugin, it can use it to randomize the announcements.
- Update a HS device with the last number entries. This can be displayed in HS Touch or custom web pages.
- Send email alerts and warnings for defined lock events (low batteries, locking action incomplete, etc.).
- If you use mrhappy's fantastic Pushover plugin, it can send Pushover alerts and warnings for defined lock events.
- If you use Jon00's equally fantastic Jon00RCCNM unmanaged plugin, it can send alerts and warnings to its clients as well.
This script should work for any kind of lock that has a notification device.
I call the script using the following event (one for each lock):
This is based on changes to the lock's notification child device. The script requires 1 parameter to be passed to it which is the door/lock name.
The attached zip file contains 2 files:
- doorlock.vb. Place this in your \Scripts folder
- doorlock.aspx. Place this in your \html folder
Important Note: You must modify your settings.ini file in the \Config folder for the script to work by adding the following setting to the ScriptingReferences= line under the [settings] section while HS is shut down. Adjust the path to System.Data.SQLite.dll as per your own system and only include the trailing comma if you have other scripting references after this one.
Code:
System.Data.SQLite;C:\Program Files (x86)\HomeSeer HS3\Bin\System.Data.SQLite.dll,
Code:
[settings] ScriptingReferences=System.Data.SQLite;C:\Program Files (x86)\HomeSeer HS3\Bin\System.Data.SQLite.dll
How the script behaves can be configured using the provided web page (doorlock.aspx) and the configuration parameters are stored in an INI file called doorlock.ini in the \Config subfolder. The INI file can also be manually updated if you wish. A default INI file is created when you first run the script or web page. When the web page (doorlock.aspx) is first loaded, it shows the General Settings:
Once you add a lock by entering a name for it in the Locks field and clicking Submit, you are taken to the main configuration parameters for the lock where you enter the Reference ID for the lock's notification device and the Reference ID for the device where you want to log the latest lock events to:
Once you have entered those and clicked on Submit, the web page queries all the possible Value-Status pairs from the lock's notification device and displays them on the screen. Each one can now be configured as needed for notifications and announcements:
Cheers
Al
Changelog:
3.x Original versions
4.0 Internal version for testing
5.x Test versions using database
6.0 Now uses a database, all config options are moved to an INI File, and a Web Page for configuration is now included.
6.1.1 Minor bug fix, improved debug logging and will use status-value pair for message if no specific message has been defined.
6.2 Minor bug fixes, moved Pushover function to main script, easier config of Pushover settings. Now has option to create the logging device from the config page, and will try to determine the lock's notification device reference id.
6.4 Added support for special tags in the Action Message and uses correct paths for Windows & linux.
6.7 Added support for the Random plugin and also for sending notifications to the Jon00RCCNM client.
6.9 Added support for linux (thanks to Igorski88 for all the testing!)
6.95 Updated to support the additional Pushover Parameter.
NOTE: The separator character in the INI file was changed from , to | in version 6.4. If you are upgrading from a 6.0-6.3 version, then you MUST open doorlock.aspx and look at the settings for each of your locks. Doing so updates the INI file to the new separator. If you are going straight from 3.x, 4.x, 5.x to 6.4 or newer, then this does not affect you.
Comment