Announcement

Collapse
No announcement yet.

Questions et Al...

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

  • Questions et Al...

    1) The JSON interface, is this an alternative to the Plugin SDK through .NET? Can I added devices to control with it - seems no but did not know if I was not seeing something.

    2) I have written a whole project to control my Whole Home Audio system through a .NET application. I would like to wrap a plugin around it. I have been referencing MoskusSample plugin as a reference. I am having an issue trying to follow some of the logic in the InitIO function.

    My HomeSeerApi does not have a class called VSPair, I only have HomeSeerAPI.VSVGPairs or just Pair. Is there something between C# and VB.NET that I am missing? Perhaps the objects changed? I sense this is basic and I am just missing a reference to something. I have Scheduler, HSCF, and HomeSeerAPI all referenced.

    For Moskus Sample:

    SVpair = New HomeSeerAPI.VSPair(HomeSeerAPI.ePairStatusControl.Both)
    SVpair.PairType = HomeSeerAPI.VSVGPairType.Range
    SVpair.RangeStart = 1
    SVpair.RangeEnd = 9

    Thanks in advance for any help.

  • #2
    2) Just had a thought... It appears to be a nested class of VSVGPairs now: HomeSeerAPI.VSVGPairs.VSPair p = new VSVGPairs.VSPair(ePairStatusControl.Both);

    Comment


    • #3
      What sort of logic are you having issue with, InitIO just gets called when the plugin loads and enables you to do what you need to do to start your hardware. The recommendation is that a thread is started to do this work if you are doing anything complex that will take time to complete. If you use the com port dropdown in the HS plugin interfaces page the port name will be passed here but other than that not a lot else happens in here.

      The JSON interface only really has methods to control devices that have already been created in HS so unless you wish to have a script to create the devices (or do it manually) then this won't do everything you are after.
      My Plugins:

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

      Comment


      • #4
        Thanks MrHappy. That is what I gathered as well from the JSON.

        Well since this is my first HS Pluggin I am claiming newbie status. I have a 12 Zone home Audio system. The first thing I need to do is create the Zones so they can be controlled.

        Some of the events of a zone would be Volume controller, Bass/Treble, balance, input, etc.

        By looking at the example I am trying to see how to add devices.

        Comment


        • #5
          Originally posted by jmta16 View Post
          Thanks MrHappy. That is what I gathered as well from the JSON.

          Well since this is my first HS Pluggin I am claiming newbie status. I have a 12 Zone home Audio system. The first thing I need to do is create the Zones so they can be controlled.

          Some of the events of a zone would be Volume controller, Bass/Treble, balance, input, etc.

          By looking at the example I am trying to see how to add devices.
          Welcome to the rather intriguing world of the HS plugin interface. I would work out your devices and how many you need first, then create a function that perhaps you pass a zone number to it and it will create the block of devices for you per zone. I don't know about in the example you are using but creating devices is relatively straightforward using hs.NewDeviceRef. Do your homework first though, look at Value/Graphics pairs and look at Value/Status pairs. Getting them right first time will minimise any later headache if you try and change them in six months time when you have a load of events matched with them. Also look at the Device API's, there is one labelled SourceSwitch which is "Device is owned/managed by a plug-in and is a matrix switch device" which might fit your situation. Again getting this right first time is worthy of a bit of research before.

          There are a number of ways to do this but when you go into InitIO you can either;

          1) If you set the address of a device when you create one check whether any device exists in HS with this address (hs.DeviceExistsAddress), if not create the devices.

          2) Run through the device enumerator (hs.GetDeviceEnumerator) and then check the interface property of all of the devices in HS. If one exists with your plugin name then you at least have one device in the HS database that belongs to your plugin. You can then check either the address or store data in the clsPlugExtraData as to what sort of device this is, creating any that you need to.

          3) Any other method I have probably missed.

          If you don't check the devices well enough you can all of a sudden end up with HS stuck in a loop creating thousands of devices, I've been there more times than I care to remember with 30,000 devices created just because I have been careless with the checking.

          Good luck.
          My Plugins:

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

          Comment


          • #6
            Thank you again for your response. I was in the process of creating a helper class which I could pass a zone number or name into and have it created.

            The example I was referencing was here: http://board.homeseer.com/showthread...t=MoskusSample

            I will plug away based on your recommendations. Thank you!!

            Comment


            • #7
              So when you say checking... where perhaps do you go first? The api documentation seems a bit rough and outdated, I may be a bit harsh as I am new and perhaps there are multiple places highlighting correct or incorrect resources. The first place I have looked is under the Support menu and HS3 Developer Kit (SDK) Help Files. Which for the smart @$$es at home would be HDK (Just kidding Homeseer).

              Thanks for any direction in the right place.

              Comment


              • #8
                Originally posted by jmta16 View Post
                So when you say checking... where perhaps do you go first? The api documentation seems a bit rough and outdated, I may be a bit harsh as I am new and perhaps there are multiple places highlighting correct or incorrect resources. The first place I have looked is under the Support menu and HS3 Developer Kit (SDK) Help Files. Which for the smart @$$es at home would be HDK (Just kidding Homeseer).

                Thanks for any direction in the right place.
                You get the SDK which I imagine is the one you have found homeseer.com/support/homeseer/HS3/SDK/default.htm and that is about it. There is the development webinar on YouTube here https://www.youtube.com/watch?v=1TjSOfARK4Y which again is of value. There is also some sticky posts in this forum containing some valuable stuff.

                Some of the stuff in the SDK is outdated or missing, that's part of the fun.
                My Plugins:

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

                Comment

                Working...
                X