Announcement

Collapse
No announcement yet.

Event_Group_Info_All

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

    Event_Group_Info_All

    http://www.homeseer.com/support/home...group_info.htm

    Hi all,

    I'm after a simple script to loop through the events, does anyone have anything handy to get me started?
    There are no real examples of how to use the functions in the link above.

    Thanks

    #2
    Code:
    Sub Main(ByVal Parm As Object)
    
        Try
    
            Dim ListOfEvents() As strEventData = hs.Event_Info_All
    
            For Each singleEvent As strEventData In ListOfEvents
                hs.writelog("Event List", "Event Name: " & singleEvent.Event_Name)
            Next
    
        Catch ex As Exception : hs.writelog("Event List", "Exception: " & ex.message)
        End Try
    
    End Sub
    Would run through the events and put the names into the logs if that is a help...

    Comment


      #3
      Originally posted by mrhappy View Post
      Would run through the events and put the names into the logs if that is a help...
      Perfect, exactly what I needed, thanks!!

      Comment


        #4
        Hi @mrhappy,

        Getting an error with the below

        Code:
        Dim ListOfEvents() As strEventGroupData = hs.Event_Info_All
        Error:
        Error 5 Value of type '1-dimensional array of HomeSeerAPI.strEventData' cannot be converted to '1-dimensional array of tenScripting3.ListUpcomingEvents.strEventGroupData' because 'HomeSeerAPI.strEventData' is not derived from 'tenScripting3.ListUpcomingEvents.strEventGroupData'. C:\Users\user\Desktop\misc\tenScripting3\tenScripting3\Upcom ingEvents.vb 41 51 tenScripting3

        Comment


          #5
          I'm not sure on that one, could be a Tenscripting issue because it works run alone if you check by running it normally. I don't use Tenscripting to know though...

          Comment


            #6
            I just completed a script to report all events. I was really disappointed to see the function hs.Event_Info_All does not expose the actual values in the structure. Pretty much makes the report useless. Does anyone know if this is possible?

            I've attached the script. Remove the .txt from the filename. Configure the first four lines, run it in an event.

            (and fyi, I used Tenscripting to create/test.)
            Attached Files
            Mike

            Comment


              #7
              Got it working

              Code:
                      For Each singleEvent As HomeSeerAPI.strEventData In hs.Event_Info_All
                          hs.WriteLog("EventList", "event name : " & singleEvent.Event_Name)
                      Next

              Comment


                #8
                Originally posted by mwaite View Post
                I just completed a script to report all events. I was really disappointed to see the function hs.Event_Info_All does not expose the actual values in the structure. Pretty much makes the report useless. Does anyone know if this is possible?

                I've attached the script. Remove the .txt from the filename. Configure the first four lines, run it in an event.

                (and fyi, I used Tenscripting to create/test.)
                if you mean the device values that may be used as the trigger then no you can't get them, triggers/actions do not even have to be stored in the HS DB any more and if they are they can be complex object types you can't decode.

                Comment


                  #9
                  Originally posted by mrhappy View Post
                  if you mean the device values that may be used as the trigger then no you can't get them, triggers/actions do not even have to be stored in the HS DB any more and if they are they can be complex object types you can't decode.
                  Yeah I get that. What I don't get is why it isn't available? HS is loading a web page to present the Events, so why not expose this? In HS2 there were methods of documenting your Events. You could even print-out the full Events web page. In HS3 there is nothing. No way to have a report/view of all events and their properties/elements. With almost 300 events, many of them fairly lengthy, I just want a documented backup that I can read. If an event gets accidentally deleted, must I restore an archive database to view it? Seems short-sighted in my opinion. (Just ranting - )
                  Mike

                  Comment


                    #10
                    Originally posted by mwaite View Post
                    Yeah I get that. What I don't get is why it isn't available? HS is loading a web page to present the Events, so why not expose this? In HS2 there were methods of documenting your Events. You could even print-out the full Events web page. In HS3 there is nothing. No way to have a report/view of all events and their properties/elements. With almost 300 events, many of them fairly lengthy, I just want a documented backup that I can read. If an event gets accidentally deleted, must I restore an archive database to view it? Seems short-sighted in my opinion. (Just ranting - )
                    Don't get me wrong I completely agree and I believe it was actively discussed somewhere about this. On the other hand I know why they have designed it this way and can see where there are benefits compared to the much easier methods in HS2. I guess you would end up calling into each plugin in turn (on an account of it not being stored in the DB) and providing the trigger/sub trigger number to the TriggerFormatUI / ActionFormatUI to retrieve the string that HS displays in the events page. They are public functions and depending on how the plugin is written you may be able to query these yourself albeit I don't know whether you can get the TANumber/SubTANumber from the event scripting functions to put into those functions though.

                    Comment


                      #11
                      I'd like to be able to get the event trigger days/time, is this possible?
                      I've done this in a HS2 script, now trying to convert to to HS3.

                      Thanks

                      Comment


                        #12
                        I don't think you can just looking at the documentation - does not appear to be exposed in the structure http://www.homeseer.com/support/homeseer/HS3/HS3Help/streventdata.htm

                        Comment


                          #13
                          That's a shame, I used the script to sort events by date/time, so I could see the events that were upcoming for any given day.
                          Arrgghhhhh....

                          Comment


                            #14
                            Getting strange error here

                            I've cut-n-paste the code from above (shown below) and am getting an error I've never seen before

                            Warning VB.Net script exception(0), re-starting: Object reference not set to an instance of an object.

                            The the script appears to restart but never stop (have to restart HS) to make it go away.

                            Here's the code

                            For Each singleEvent As HomeSeerAPI.strEventData In hs.Event_Info_All
                            hs.WriteLog("EventList", "event name : " & singleEvent.Event_Name)
                            Next

                            Any ideas?

                            Comment


                              #15
                              Originally posted by madmellow View Post
                              I've cut-n-paste the code from above (shown below) and am getting an error I've never seen before

                              Warning VB.Net script exception(0), re-starting: Object reference not set to an instance of an object.

                              The the script appears to restart but never stop (have to restart HS) to make it go away.

                              Here's the code

                              For Each singleEvent As HomeSeerAPI.strEventData In hs.Event_Info_All
                              hs.WriteLog("EventList", "event name : " & singleEvent.Event_Name)
                              Next

                              Any ideas?
                              Is this through TenScripting or some other method, are you able to post your exact script (if there is more) in case it is something else causing the issue.

                              Comment

                              Working...
                              X