Announcement

Collapse
No announcement yet.

Going through Events

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

  • Going through Events

    HS2 had the quite useful EventEnumerator.

    How can we loop through events in HS3?
    HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
    Running on Windows 10 (64) virtualized
    on ESXi (Fujitsu Primergy TX150 S8).
    WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

    Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

  • #2
    You can see the fun here http://forums.homeseer.com/showthread.php?t=165610 but reading the scripting docs I wonder if you can get a list of events using Event_Info_All and then examine the structure to get the names of the events...depends what you are trying to do with them though as to whether that helps.
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Thanks!
      That way you can at least get the reference and Name.

      Now I wonder if Linq is supported or not in HS3. I believe it was, but I can't get it to work now...
      HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
      Running on Windows 10 (64) virtualized
      on ESXi (Fujitsu Primergy TX150 S8).
      WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

      Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

      Comment


      • #4
        Originally posted by Moskus View Post
        Thanks!
        That way you can at least get the reference and Name.

        Now I wonder if Linq is supported or not in HS3. I believe it was, but I can't get it to work now...
        Hi Moskus, did you ever get this working? I was looking to create a script to enumerate all the events and loop through them. Do you have something you can share?

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

        Comment


        • #5
          Originally posted by sparkman View Post
          Hi Moskus, did you ever get this working? I was looking to create a script to enumerate all the events and loop through them. Do you have something you can share?

          Thanks
          Al
          Sure!
          But sadly, Linq isn't as supported as we could have hoped. It seems that the compiler isn't 100% there for some reason.

          I hope you use tenScripting, there you can test this directly.

          Code:
              Public Function Events() As System.Collections.Generic.List(Of HomeSeerAPI.strEventData)
                  Dim _events As New System.Collections.Generic.List(Of HomeSeerAPI.strEventData)
                  For Each e As HomeSeerAPI.strEventData In hs.Event_Info_All
                      _events.Add(e)
                  Next
                  Return _events
              End Function
          
              Public Sub Test()
                  Dim myEvents = From e In Events()
                                 Where e.Flag_Enabled AndAlso e.Flag_Do_Not_Log
              End Sub
          If you run the sub Test(), the myEvents variable will be a list (of type HomeSeerAPI.strEventData) of all events that are enabled and are set to not write to the log when triggered.

          The Events() function is just a quick Linq wrapper I wrote. It just gathers information from hs.Event_Info_All, and you can use that directly if you prefer.

          Alot of fun!
          HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
          Running on Windows 10 (64) virtualized
          on ESXi (Fujitsu Primergy TX150 S8).
          WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

          Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

          Comment


          • #6
            Originally posted by Moskus View Post
            Sure!
            But sadly, Linq isn't as supported as we could have hoped. It seems that the compiler isn't 100% there for some reason.

            I hope you use tenScripting, there you can test this directly.

            Code:
                Public Function Events() As System.Collections.Generic.List(Of HomeSeerAPI.strEventData)
                    Dim _events As New System.Collections.Generic.List(Of HomeSeerAPI.strEventData)
                    For Each e As HomeSeerAPI.strEventData In hs.Event_Info_All
                        _events.Add(e)
                    Next
                    Return _events
                End Function
            
                Public Sub Test()
                    Dim myEvents = From e In Events()
                                   Where e.Flag_Enabled AndAlso e.Flag_Do_Not_Log
                End Sub
            If you run the sub Test(), the myEvents variable will be a list (of type HomeSeerAPI.strEventData) of all events that are enabled and are set to not write to the log when triggered.

            The Events() function is just a quick Linq wrapper I wrote. It just gathers information from hs.Event_Info_All, and you can use that directly if you prefer.

            Alot of fun!
            Great, thanks, will give it a try!

            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