Announcement

Collapse
No announcement yet.

HS Suggested commands in visual studio

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

    HS Suggested commands in visual studio

    I can not find the thread how to do to get homeseer suggested commands in Visual Studio when writing plugin like Tenscripting editor has.

    /Thanks
    Last edited by tonlof; March 4, 2010, 04:35 PM.
    Please excuse any spelling and grammatical errors I may make.
    --
    Tasker Plugin / Speech Droid
    Tonlof | Sweden

    #2
    If you're using TenScripting then why just don't use that?

    Or are you planning to do something else?
    For a custom project you need to import the Scheduler.dll. You'll find it in your homeseer directory.
    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


      #3
      I believe all that you need to do is to add a reference to the Scheduler.dll, HS2Util.dll and HomeSeer2.dll files.
      HS4Pro on a Raspberry Pi4
      54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
      Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

      HSTouch Clients: 1 Android

      Comment


        #4
        Oh yes, I forgot about those.

        After you have added those references, you can do something like this:

        Code:
        Imports HomeSeer2
        
        
            Public hsinterface As HomeSeer2.application
            Public hs As Scheduler.hsapplication
        
            Sub Main()
                '==========
                'Connecting
                '==========
                Try
                    hsinterface = New HomeSeer2.application
        
                    'You might need to change these values
                    hsinterface.SetHost("localhost")
                    Dim rval As String = hsinterface.Connect("default", "default")
        
                    If rval <> "" Then
                        MsgBox("Unable to connect to HomeSeer: " & rval)
                        Exit Sub
                    Else
                        'We are connected
                    End If
        
                    hs = hsinterface.GetHSRef
                Catch ex As Exception
                    MsgBox(ex.Message)
                End Try
        
        
        
                '=================================
                'Now we can start programming! :-)
                '=================================
                If hs.IsOn("A7") Then
                    hs.ExecX10("A7", "Off")
                Else
                    hs.ExecX10("A7", "On")
                End If
            End Sub
        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


          #5
          I might have misunderstood but I thought tenscripting was only for scripting and not plugins?
          Originally posted by Moskus View Post
          If you're using TenScripting then why just don't use that?

          Or are you planning to do something else?
          For a custom project you need to import the Scheduler.dll. You'll find it in your homeseer directory.
          The first thing I did was to add Scheduler.dll, HS2Util.dll and HomeSeer2.dll reference before but it did not do the trick.

          Originally posted by rmasonjr View Post
          I believe all that you need to do is to add a reference to the Scheduler.dll, HS2Util.dll and HomeSeer2.dll files.
          Please excuse any spelling and grammatical errors I may make.
          --
          Tasker Plugin / Speech Droid
          Tonlof | Sweden

          Comment


            #6
            Thanks Moskus, I will try that.

            //Tonlof
            Originally posted by Moskus View Post
            Oh yes, I forgot about those.

            After you have added those references, you can do something like this:

            Code:
            Imports HomeSeer2
             
             
                Public hsinterface As HomeSeer2.application
                Public hs As Scheduler.hsapplication
             
                Sub Main()
                    '==========
                    'Connecting
                    '==========
                    Try
                        hsinterface = New HomeSeer2.application
             
                        'You might need to change these values
                        hsinterface.SetHost("localhost")
                        Dim rval As String = hsinterface.Connect("default", "default")
             
                        If rval <> "" Then
                            MsgBox("Unable to connect to HomeSeer: " & rval)
                            Exit Sub
                        Else
                            'We are connected
                        End If
             
                        hs = hsinterface.GetHSRef
                    Catch ex As Exception
                        MsgBox(ex.Message)
                    End Try
             
             
             
                    '=================================
                    'Now we can start programming! :-)
                    '=================================
                    If hs.IsOn("A7") Then
                        hs.ExecX10("A7", "Off")
                    Else
                        hs.ExecX10("A7", "On")
                    End If
                End Sub
            Please excuse any spelling and grammatical errors I may make.
            --
            Tasker Plugin / Speech Droid
            Tonlof | Sweden

            Comment


              #7
              Originally posted by tonlof View Post
              I might have misunderstood but I thought tenscripting was only for scripting and not plugins?
              Yes, that's correct. But I would NOT suggest that you start from scratch when writing a plugin. There's an example in the HomeSeer SDK, and an even better Template created by UltraJones, and found here:

              http://board.homeseer.com/showthread.php?t=109798

              Use that, import the Scheduler.dll and you can use all the IntelliSense you want.
              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


                #8
                I finally find out how to only activate this function.

                Add reference Scheduler.dll

                Imports Scheduler

                Public hs As Scheduler.hsapplication

                PS
                What is the best hs template to start with when using Visual Basic 2008 Express?
                Please excuse any spelling and grammatical errors I may make.
                --
                Tasker Plugin / Speech Droid
                Tonlof | Sweden

                Comment


                  #9
                  The HS SDK has a complete plugin.
                  💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                  Comment


                    #10
                    Hi Rupp, yes for 2003 & 2005 and when I use Vb 2008 it automatic convert it with some errors.
                    Originally posted by Rupp View Post
                    The HS SDK has a complete plugin.
                    Please excuse any spelling and grammatical errors I may make.
                    --
                    Tasker Plugin / Speech Droid
                    Tonlof | Sweden

                    Comment


                      #11
                      Try the plugin template from Ultrajones. It converts without problems, a few warnings only, but that's easy to clean up (e.g. remove the database options if you don't use them):
                      http://board.homeseer.com/showthread.php?t=109798

                      Also I found it to be a cleaner template. The example in the SDK needs a lot of cleaning....
                      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


                        #12
                        Originally posted by tonlof View Post
                        Hi Rupp, yes for 2003 & 2005 and when I use Vb 2008 it automatic convert it with some errors.
                        Odd, as I just opened up the hspi_NetSample in VS2008 and it converted with no issues. See attchment.
                        Attached Files

                        Comment

                        Working...
                        X