Announcement

Collapse
No announcement yet.

Script to list events that have script actions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Script to list events that have script actions

    Hi all,

    Please post comments, questions, etc. in this thread: https://forums.homeseer.com/showthread.php?t=187188.

    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 along with an aspx file (web page) 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 web page will show each file in the Scripts folder and which events call it:
    Click image for larger version

Name:	Capture2.PNG
Views:	1
Size:	43.8 KB
ID:	1210557

    and also each event that calls one or more script files:
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	20.8 KB
ID:	1210559

    The specific script files are identified and if there's one missing in the scripts folder, it is shown in red for easy identification.

    There's a report for immediate script commands:
    Click image for larger version

Name:	Capture4.PNG
Views:	2
Size:	51.0 KB
ID:	1210565


    There are additional reports available as well and others may be added in future releases. If there's something you would like to see added, let me know.

    Save the scripteventsASPX.vb.txt file without the .txt extension in the HS3 Scripts folder and and save scriptevents.aspx.txt without the .txt extension in the HS3 html folder. To see the reports, access them by browsing to this url:
    Code:
    http://www.xxx.yyy.zzz:pp/scriptevents.aspx
    Replace www.xxx.yyy.zzz with the ip address of your HS server and pp with the port number used by your HS web server. Once you have it open, then pick " - Settings" from the drop down and re-configure any of the settings as needed:
    Click image for larger version

Name:	Capture3.PNG
Views:	1
Size:	22.1 KB
ID:	1210558

    The script requires the exact case to your scripts folder as used by your events. Check some events on your system to confirm what the exact case is. On my system, the path was listed using two different cases, so that's why there are two fields. If you find a different case syntax than these defaults, let me know.

    By default, the script will query the production HS3 database file. It's not making any modifications, just retrieving info from it. However, if you feel uncomfortable with that, create a copy of your HS3 database file in the \Data folder and provide the filename to the copy in the settings.

    Important Note: You must modify your settings.ini file in the \Config folder for the script page 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. The latest version of the script/web page checks for this and it will display that the scripting reference is not there and add it for you. You will need to restart HS after that.

    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.


    Version - Description
    0.0.3 - Original Release
    0.0.8 - Test version splitting functions out of aspx file
    0.1.0 - Released "split" version an bug fixes and functionality enhancements
    0.1.1 - Added report for immediate script commands, code enhancements and bug fixes


    Cheers
    Al
    Last edited by sparkman; February 12, 2017, 09:18 AM.
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    #2
    Placeholder.
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Just found this. Great utility.
      Don

      Comment

      Working...
      X