Announcement

Collapse
No announcement yet.

Script to list events that have script actions - Discussion Thread

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

  • sparkman
    replied
    Originally posted by larhedse View Post
    Will this work on Linux?
    Not 100% sure. I don’t know if anyone else is running it on linux. Please give it a try and let me know if you run into any issues.

    Leave a comment:


  • larhedse
    replied
    Will this work on Linux?

    Leave a comment:


  • donstephens
    replied
    Thanks!

    Leave a comment:


  • sparkman
    replied
    Hi Don,

    Here's a quick script.

    Code:
    Sub Main(ByVal Parms As object)
    
    	Dim logName As String = "Event List"
    	Dim Debug As String = True
    
    	Dim EventArray() As strEventData = hs.Event_Info_All() 
    	If Debug Then hs.writelog(logName, CStr(EventArray.GetUpperBound(0)) & " Events Found")
    
    	For i As Integer = 0 To EventArray.getupperbound(0) - 1
    		If Debug Then hs.writelog(logName, EventArray(i).GroupName & " - " & EventArray(i).Event_Name)
    	Next
    
    End Sub
    Cheers
    Al

    Leave a comment:


  • langenet
    replied
    Thanks Al for this. It's a nice tool to help manage the inventory of events with.

    Robert

    Leave a comment:


  • sparkman
    replied
    New version has been posted with various enhancements and a few bug fixes. The enhancements include updating the Scripting References automatically if needed, and that it now also generates a report with events with Immediate Script Actions. Just overwrite the previous version with the new one.

    Cheers
    Al

    Click image for larger version

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

    Leave a comment:


  • sparkman
    replied
    New version available

    Hi all,

    A new version has been posted here: https://forums.homeseer.com/showthre...44#post1291644. This version no longer creates static reports, only dynamic reports generated through a web page. There is now also an option to generate the report in the standard HS3 table format or the simple format that was available in prior versions.

    Please provide feedback, questions, etc. in this thread.

    Cheers
    Al

    Leave a comment:


  • sparkman
    replied
    Originally posted by jhirschhorn View Post
    Sparkman,
    This new version works perfectly. Awesome job.

    Thanks.
    Originally posted by langenet View Post
    Thanks Al. Works great now. Much appreciated!

    Another great tool!

    Awesome!!!

    Robert
    Thanks gentlemen, glad it's working for you. I will move the files to the main post.

    Cheers
    Al

    Leave a comment:


  • langenet
    replied
    Thanks Al. Works great now. Much appreciated!

    Another great tool!

    Awesome!!!

    Robert

    Leave a comment:


  • jhirschhorn
    replied
    Sparkman,
    This new version works perfectly. Awesome job.

    Thanks.

    Leave a comment:


  • sparkman
    replied
    @langenet and @jhirschhorn

    Attached is a version that uses the script file for the SQLite portion. Can you try it out. Remove the .txt extension and drop the .vb file in the Scripts folder and the .aspx file in the html folder and then open the .aspx file. Let me know if that works for you.

    Cheers
    Al
    Last edited by sparkman; February 11, 2017, 02:45 AM. Reason: Test files removed. Will be moved to main thread.

    Leave a comment:


  • sparkman
    replied
    Originally posted by jhirschhorn View Post
    Since you asked, I'm having exactly the same issue. Runs as an event, not as a ASPX page. I also have Jon00s charting working, and that also uses SQLite. I also have a few events which call my scripts that write to my own SQLite DB.

    My observation is that it works from the script side, and in ASPX pages with a CodeBehind VB pages where the SQL is in the VB files, but not in ASPX only pages, even with the import namespace directive. I've also tried adding a reference to the SQLite namespace in HS web.config file with luck. For some reason the ASPX page can't resolve the namespace. Not sure why.

    I was hoping to give it a few more days to see if anyone can find a resolution, after that I was going to try and split your code into an ASPX and codebehind VB file when I get time.
    Thanks for letting me know. Not sure why it works on my system then. If I remove the import for the Sqlite namespace, I get the same error as you guys, so in my case HS is including it in the compile. I'll see if I can split the code and just reference the function in the vb file that I have.

    Cheers
    Al

    Leave a comment:


  • jhirschhorn
    replied
    Originally posted by sparkman View Post
    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
    Since you asked, I'm having exactly the same issue. Runs as an event, not as a ASPX page. I also have Jon00s charting working, and that also uses SQLite. I also have a few events which call my scripts that write to my own SQLite DB.

    My observation is that it works from the script side, and in ASPX pages with a CodeBehind VB pages where the SQL is in the VB files, but not in ASPX only pages, even with the import namespace directive. I've also tried adding a reference to the SQLite namespace in HS web.config file with luck. For some reason the ASPX page can't resolve the namespace. Not sure why.

    I was hoping to give it a few more days to see if anyone can find a resolution, after that I was going to try and split your code into an ASPX and codebehind VB file when I get time.

    Leave a comment:


  • langenet
    replied
    Thanks.. yeah seems odd as my HS3 folder is very clean since I migrated less than a year ago with a fresh install. I have had no other problems and my system runs very well. My system is on Windows 2003 server however. So unless there's a path related problem - using C:\Program Files\HomeSeer HS3 I can't see why it doesn't work.

    Robert

    Leave a comment:


  • sparkman
    replied
    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

    Leave a comment:

Working...
X