Announcement

Collapse
No announcement yet.

Script to list events that have script actions - Discussion Thread

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

  • #16
    Originally posted by langenet View Post
    This is super great Al. Though, I did try it and edited into the aspx file my hsd filename and path to SQLite but get the following error.

    Robert
    Hi Robert, there's nothing that needs to be edited in the aspx file. All the configuration items are now in an ini file and edited through the web page when you first open it.

    Cheers
    Al
    HS 3.0.0.548: 1976 Devices 1156 Events
    Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

    Comment


    • #17
      Thanks... I kinda figured that out after I made the comment.

      Can you clear up an issue that I have with respect to the namespace setting in settings.ini. When do you use the semicolon and when do you use comma? I was under the impression use the comma when the namespace root is the same. This might be my issue...


      Robert
      HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

      Comment


      • #18
        Originally posted by langenet View Post
        Thanks... I kinda figured that out after I made the comment.

        Can you clear up an issue that I have with respect to the namespace setting in settings.ini. When do you use the semicolon and when do you use comma? I was under the impression use the comma when the namespace root is the same. This might be my issue...


        Robert
        The semicolon is between the first part (namespace) and the second part (dll for that namespace). Commas are used to separate multiple entries. Post your whole line, but wrap code tags around it as the forum seems to insert random spaces in regular text.

        Cheers
        Al
        HS 3.0.0.548: 1976 Devices 1156 Events
        Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

        Comment


        • #19
          I think this has gotten messy over time - thanks.

          PHP Code:
          ScriptingReferencesSystem.Management;System.Management.dll;System.XML;System.XML.dll,MySql.Data.MySqlClient;C:\Program Files\MySQL\MySQL Connector Net 5.1.7\Binaries\.NET 2.0\MySql.Data.dll,System.Data;System.Data.dll,System.Drawing;System.Drawing.dll,System.Drawing.Image;System.Drawing.dll,System.Web;System.web.dll;System.Data.SQLite;C:\Program Files\HomeSeer HS3\Bin\System.Data.SQLite.dll 
          Much appreciated...

          Robert
          HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

          Comment


          • #20
            Try this:

            Code:
            ScriptingReferences=System.Management;System.Management.dll,System.XML;System.XML.dll,MySql.Data.MySqlClient;C:\Program Files\MySQL\MySQL Connector Net 5.1.7\Binaries\.NET 2.0\MySql.Data.dll,System.Data;System.Data.dll,System.Drawing;System.Drawing.dll,System.Web;System.web.dll,System.Data.SQLite;C:\Program Files\HomeSeer HS3\Bin\System.Data.SQLite.dll
            You had the system.drawing one in there twice, once with a sub name space so I removed that as I don't think you need to do that. You will need to restart HS after changing it.

            Cheers
            Al
            HS 3.0.0.548: 1976 Devices 1156 Events
            Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

            Comment


            • #21
              Thanks Al, but the error has not been resolved.

              Compiler Error Message: BC30002: Type 'SQLiteConnection' is not defined.

              Source Error:




              Line 47:
              Line 48: 'Declare the main SQLite data access objects
              Line 49: Dim cnn As SQLiteConnection = Nothing
              Line 50: Dim comm As SQLiteCommand = Nothing
              Line 51: Dim rdr As SQLiteDataReader = Nothing


              Source File: C:\Program Files\HomeSeer HS3\html\scriptevents.aspx Line: 49
              HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

              Comment


              • #22
                Not sure what could be causing that. I just tried it here without having the reference to that dll, and it works fine, so it looks like it is just needed by the script. Can you redownload the aspx file and overwrite the one you have? Maybe remove the reference too.
                Last edited by sparkman; February 8th, 2017, 09:36 PM.
                HS 3.0.0.548: 1976 Devices 1156 Events
                Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                Comment


                • #23
                  Al... what's your file size for the System.Data.SQLite.dll in the bin directory? Mine is only 246 km with a date of 2/14/2014 9:58 AM. I use Jon's charting tool and notice the one there is 1026 kb with an original date of 9/12/2014 8:20PM.

                  Robert
                  HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                  Comment


                  • #24
                    Hi Robert, mine is 246kb with a date of 2016-05-06. I think this is the same one that is used by the HS3 app to read/write to its databases. What version of HS3 are you on?

                    Cheers
                    Al
                    HS 3.0.0.548: 1976 Devices 1156 Events
                    Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                    Comment


                    • #25
                      I'm running .297.

                      Now I am running as a service using Fire Daemon. Though, I can run every aspx file that Jon has created...

                      More detail from IE.

                      PHP Code:
                      C:\Program Files\HomeSeer HS3> "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\vbc.exe" /t:library /utf8output /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\assembly\dl3\39ca66c8\f71ed413_a1fec901\MySql.Web.DLL" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\assembly\dl3\f221a6ff\7b214333_a1fec901\MySql.Data.DLL" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\assembly\dl3\475ceea4\004ccb8a_e5fed101\HomeSeerUtil.DLL" /R:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\App_global.asax.qdjhgh0z.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\assembly\dl3\4df6b3f5\00ad7e05_c6bdc601\netchartdir.DLL" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\assembly\dl3\ed8817a3\0072294a_c003d201\Scheduler.DLL" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\assembly\dl3\0ec5b831\00eb9546_c003d201\HomeSeerAPI.DLL" /R:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\assembly\dl3\aa0ea64e\004ccb8a_e5fed101\HSCF.DLL" /out:"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\App_Web_0wjtpwwc.dll" /debug- /nowarn:41008 /define:_MYTYPE=\"Web\" /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Collections.Specialized,System.ComponentModel.DataAnnotations,System.Configuration,System.Linq,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.DynamicData,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls,System.Xml.Linq /warnaserror- /optionInfer+  "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\App_Web_0wjtpwwc.0.vb" "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\App_Web_0wjtpwwc.1.vb"


                      Microsoft (RVisual Basic Compiler version 10.0.30319.233
                      Copyright 
                      (cMicrosoft Corporation.  All rights reserved.

                      C:\Program Files\HomeSeer HS3\html\scriptevents.aspx(49) : error BC30002Type 'SQLiteConnection' is not defined.

                              
                      Dim cnn As SQLiteConnection Nothing
                                         
                      ~~~~~~~~~~~~~~~~          
                      C:\Program Files\HomeSeer HS3\html\scriptevents.aspx(50) : error BC30002Type 'SQLiteCommand' is not defined.

                              
                      Dim comm As SQLiteCommand Nothing
                                          
                      ~~~~~~~~~~~~~          
                      C:\Program Files\HomeSeer HS3\html\scriptevents.aspx(51) : error BC30002Type 'SQLiteDataReader' is not defined.

                              
                      Dim rdr As SQLiteDataReader Nothing
                                         
                      ~~~~~~~~~~~~~~~~          
                      C:\Program Files\HomeSeer HS3\html\scriptevents.aspx(68) : error BC30002Type 'SQLiteConnection' is not defined.

                                  
                      cnn = New SQLiteConnection("Data Source=" db ";Version=3;")
                                            ~~~~~~~~~~~~~~~~                                     
                      C:\Program Files\HomeSeer HS3\html\scriptevents.aspx(265) : warning BC42104Variable 'Events' is used before it has been assigned a valueA null reference exception could result at runtime.

                                  For 
                      0 To Events.GetLength(0)-1
                                               
                      ~~~~~~               
                      C:\Program Files\HomeSeer HS3\html\scriptevents.aspx(266) : warning BC42104Variable 'ScriptFiles' is used before it has been assigned a valueA null reference exception could result at runtime.

                                      For 
                      0 To ScriptFiles.GetLength(0)-1
                                                   
                      ~~~~~~~~~~~               
                      C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\29b23a33\6826ea6b\App_Web_0wjtpwwc.0.vb(21) : warning BC40056: Namespace or type specified in the Imports 'System.Data.SQLite' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn'use any aliases.

                      Imports System.Data.SQLite
                              
                      ~~~~~~~~~~~~~~~~~~ 
                      Robert
                      HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                      Comment


                      • #26
                        Did you try redownloading the aspx? Can you try the script to see if it gives the same errors (look in the HS log)? The script does need to be edited if your path and data file are different than mine. Looking at your full error message it does look like it's failing to find the dll, so not sure what is going on.
                        HS 3.0.0.548: 1976 Devices 1156 Events
                        Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                        Comment


                        • #27
                          Yes... I just re-downloaded the aspx file to try. Same deal...

                          I created a manual event using the other script and it works fine - created the two output files.


                          Feb-08 9:54:53 PM Events with Scripts Report saved as C:\Program Files\HomeSeer HS3\html\ScriptsWithEvents.htm

                          Feb-08 9:54:53 PM Events with Scripts Report saved as C:\Program Files\HomeSeer HS3\html\EventsWithScriptActions.htm

                          Feb-08 9:54:53 PM Events with Scripts Number of Files in Scripts Directory: 48

                          Feb-08 9:54:53 PM Events with Scripts Number of Events with Script Actions: 17

                          Feb-08 9:54:52 PM Event Running script in background: C:/Program Files/HomeSeer HS3/scripts/EventswithScripts.vb

                          Thanks,

                          Robert
                          HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                          Comment


                          • #28
                            Well glad that is working for you, but pretty strange that one works, but not the other. I'll do some more research.

                            Cheers
                            Al

                            EDIT: Looking at the compiler output you have (first line in your error), it does not include System.Data.SQLite.dll. However, when I create a problem in the file, my compiler output does show System.Data.SQLite.dll as one of the references. I believe HS automatically includes this, but not 100% sure. If you have a chance and are willing, can you upgrade to .304? I'll understand if you don't want to do that.
                            Last edited by sparkman; February 8th, 2017, 10:22 PM.
                            HS 3.0.0.548: 1976 Devices 1156 Events
                            Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                            Comment


                            • #29
                              Al,

                              I'm looking at your aspx script with the hopes of getting it to write the hslog. Where can I set up debug? Any change to the Boolean "debug" has no affect.
                              My guess is that there must be a path problem ...

                              Robert
                              HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                              Comment


                              • #30
                                Originally posted by langenet View Post
                                Al,

                                I'm looking at your aspx script with the hopes of getting it to write the hslog. Where can I set up debug? Any change to the Boolean "debug" has no affect.
                                My guess is that there must be a path problem ...

                                Robert
                                Hi Robert, it fails during the compile, so never executes. Whether debug is on or off is stored in scriptevents.ini for the aspx page. You could manually create it before it runs, but I don't believe it will help given that it fails during compile, not while running. Here's the default contents of it.

                                Code:
                                [Settings]
                                Debug=False
                                ShowScriptPath=False
                                ScriptsPath1=C:/Program Files (x86)/HomeSeer HS3/scripts/
                                ScriptsPath2=C:/program files (x86)/homeseer hs3/scripts/
                                HS3DataFile=HomeSeerData.hsd
                                I have no idea why Sqlite is automatically included on my system, but not yours. Still searching for a way. I haven't heard of anyone else having the same issue nor have I heard of anyone else running it successfully. Any others having the same issue or is it working for you?

                                Cheers
                                Al
                                HS 3.0.0.548: 1976 Devices 1156 Events
                                Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                                Comment

                                Working...
                                X