2017-02-07

Hi all,

My scripts folder was getting pretty cluttered where I had no idea anymore which were "production" scripts and which were test, etc. I created a test sub-folder and moved some scripts into it only to realize that I moved some production scripts when I got errors in the log about missing scripts. So my solution was to create yet another script to help figure out which scripts were used and which were not. Since HS3 keeps most of the event details in a BLOB (Binary Large OBject), this was not straight forward, but with some binary to hex to ascii (and vice versa) conversion was possible. The script creates two HTML formatted reports:

One that shows each script file and which events call it;
Attachment 59367

and one that shows each event that calls one or more script files. The specific script files are identified and if there's one missing in the scripts folder, it is shown in red for easy identification.
Attachment 59368

Save the script without the .txt extension in the HS3 Scripts folder and create an event to run it. The reports are saved in the html sub-folder and can be opened directly in a browser for viewing or could be "served" using the HS3 web server. Please read the notes in the script file. I believe it'll only work in Windows right now, but if someone that has a linux based HS3 can test it out, I can help modify it to work for it.

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 and restart HS. 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,

If you don't have a ScriptingReferences line in your settings.ini file already, then add as follows right below the [settings] header:

Code:

[settings]

ScriptingReferences=System.Data.SQLite;C:\Program Files (x86)\HomeSeer HS3\Bin\System.Data.SQLite.dll

again adjusting the path to System.Data.SQLite.dll as per your own system.

Please post comments, questions, etc. in this thread: https://forums.homeseer.com/showthread.php?t=187188. I am looking at creating a version where rather than running this as a script, it would be a "live" web page within HS. When I first started creating this, I assume that the script would take a long time to run, but it's very quick on my system, so it should work ok as a web page.

Version - Description

0.0.3 - Original Release

0.0.4 - Minor bug fix
0.0.6 - Now searches two cases at the same time

Cheers

Al

Attached Images

 

Attached Files



EventswithScripts.vb.txt (11.9 KB)

Show more