Announcement

Collapse
No announcement yet.

HS3 Plugin Samples

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Code:
                If MyAction IsNot Nothing Then
                    Dim bteArray() As Byte = Nothing
                    If Not SerializeObject(MyAction, bteArray) Then Throw New Exception("Not able to Serialize myaction data in actionbuildui.")
    
                    Dim Ret As New IPlugInAPI.strMultiReturn
                    Ret.sResult = ""                ' Empty return indicates success!
                    Ret.TrigActInfo = ActInfo    ' Trig info does not change, just pass through what we received...
                    Ret.DataOut = bteArray
                    Return Ret
                End If
    If it ain't broke, don't fix it!

    Comment


    • To answer my own question, the following code needs to be in postprocessui not buildui.

      Originally posted by happnatious1 View Post
      Code:
                  If MyAction IsNot Nothing Then
                      Dim bteArray() As Byte = Nothing
                      If Not SerializeObject(MyAction, bteArray) Then Throw New Exception("Not able to Serialize myaction data in actionbuildui.")
      
                      Dim Ret As New IPlugInAPI.strMultiReturn
                      Ret.sResult = ""                ' Empty return indicates success!
                      Ret.TrigActInfo = ActInfo    ' Trig info does not change, just pass through what we received...
                      Ret.DataOut = bteArray
                      Return Ret
                  End If
      If it ain't broke, don't fix it!

      Comment


      • I've made a lot of progress and I think I understand the relationship between actionbuildUI, PostprocessUI, FormatUI, and configured and my plugin sort of works. however I'm profoundly stuck. see attached picture. The line of code where the break point is always evaluates as the subTAnumber even though the first expression in the OrElse statement is obviously true. According to everything I can find online the second expression shouldn't even be evaluated.
        Attached Files
        If it ain't broke, don't fix it!

        Comment


        • After sleeping on it I realized I made another newbie mistake. It does evaluate as true, however the next line of code will also be true because of the subtanumber changing. The solution was simply to remove the second expression in every orelse because it is not needed. I already have the data I need stored in MyActionData.

          One step closer.
          If it ain't broke, don't fix it!

          Comment


          • In the sample plugin their sample class is marked as serialized and then the enums within the class is also marked as serialized. Is there a reason for this? It doesn't seem to make a difference in my class.
            If it ain't broke, don't fix it!

            Comment


            • In my first plugin, I used TANumber and SubTANumber from the sample plugin. It is confusing as heck. In my second, I only use TANumber and use my own classes to manage any sub-trigger actions. It took weeks to figure out how to use them both. VERY steep learning curve.
              HS3Pro Running on a Raspberry Pi3
              64 Z-Wave Nodes, 168 Events, 280 Devices
              UPB modules via OMNI plugin/panel
              Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
              HSTouch Clients: 3 Android, 1 Joggler

              Comment


              • I'm in the middle of writing my own base plugin. It'll handle basic initialization, device creation, updating, CAPI, etc. I need a clean, general base as I have a 3 or 4 plugins I want to write. All HomeSeer functions and procedures are updated with .NET comments describing their functions (based on the SDK), which I was disappointed was missing, and I'm adding a ton o comments as there's basicly nothing now.

                I'm planning to release this here on the board when I'm done so that people don't have to go through this yet again. It'll be very simple, but hopefully a good starting point covering the basics.


                However, I haven't even touched Triggers and Actions, and I'm seriously NOT looking forward to it, as anyone that has anything to say about it, says it's rather horrible.

                However, there are plenty of plugins out there that handle it. Perhaps somebody could write a few lines to simplify it? Just walk us through some smart setup and how the different procedures work.
                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


                • Well I just spent a few hours figuring out actionconfigured and handleaction and how they interact with all the other procedures and I'm shocked to say I can now run my plugin in homeseer and turn zone1 of my monoprice amp on and off using events

                  My head is spinning and I need to go to bed.
                  If it ain't broke, don't fix it!

                  Comment


                  • I spent some hours last night piecing triggers and actions togheter. It wasn't... erm... that bad, I actually can get it to work without too much problems.
                    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


                    • I haven't looked at triggers yet but I assume they are much the same as actions based on the name strTrigActInfo. Not sure if the plugin I'm writing would even need triggers.
                      If it ain't broke, don't fix it!

                      Comment


                      • Originally posted by happnatious1 View Post
                        I haven't looked at triggers yet but I assume they are much the same as actions based on the name strTrigActInfo.
                        Yes, they are not far from each other. Actions are easier than triggers IMHO.


                        But WHY OH WHY is the class called strTrigActInfo?!???
                        It's not a string, and it's actually possible to write it completely. That way a user could stand a chance understanding what's going on!
                        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


                        • How do i even start?

                          What do i need to do to use this to make something of my own?
                          Certified installer for HomeSeer, Control4, KNX and Eaton/xComfort

                          Comment


                          • Originally posted by happnatious1 View Post
                            Well I just spent a few hours figuring out actionconfigured and handleaction and how they interact with all the other procedures and I'm shocked to say I can now run my plugin in homeseer and turn zone1 of my monoprice amp on and off using events

                            My head is spinning and I need to go to bed.
                            Originally posted by Moskus View Post
                            I spent some hours last night piecing triggers and actions togheter. It wasn't... erm... that bad, I actually can get it to work without too much problems.
                            I have become intimately familiar with setting breakpoints, stepping through code, and watch windows

                            That "sample" plugin is really difficult to follow. TANumber and SubTANumber took quite a while for me to wrap my head around. I ended up only using TANumber and my custom Action class to get around it.
                            HS3Pro Running on a Raspberry Pi3
                            64 Z-Wave Nodes, 168 Events, 280 Devices
                            UPB modules via OMNI plugin/panel
                            Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
                            HSTouch Clients: 3 Android, 1 Joggler

                            Comment


                            • Originally posted by U5tabil View Post
                              How do i even start?
                              What do i need to do to use this to make something of my own?
                              You need:
                              - Visual Studio (Express or Community can be used) with VB.net
                              - The link to the SDK: http://homeseer.com/support/homeseer...DK/default.htm
                              - A download of the samples in the first post
                              - Some experience with scripting, and some grasp of devices and events and how they work. tenScripting is a good idea.
                              - ALOT of free time

                              ... or wait a week or two until I release the my even more simplified version.



                              Originally posted by rmasonjr View Post
                              TANumber and SubTANumber took quite a while for me to wrap my head around.
                              Yeah, I'm not there yet. Do you have a simple break down?
                              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


                              • Will it be C# or VB ?

                                Comment

                                Working...
                                X