Announcement

Collapse
No announcement yet.

What are all the available functions for hs.PluginFunction?

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

    What are all the available functions for hs.PluginFunction?

    Hi all

    Can someone please identify all the available function that can be passed in the hs.PluginFunctionalong with the parameters for each Function?

    Code:
    Function PluginFunction(plugname As String, pluginstance As String, func As String, parms() As Object) As Object
    the help documentation only list one fucnaiton "Access Level" with "Nothing" as parameter

    Code:
    hs.PluginFunction("Z-Wave", "", "AccessLevel", nothing)
    or if you can point me to Where I can find the specific detail of all available Functions to pass in hs.PluginFunction


    #2
    This function provides access to exposed methods within a plugin. It is up to the plugin author, and not HST, who provides the documentation. While I have not looked I doubt if HST has any plugins that have a scripting interface. There are likely a rather limited number of 3rd party plugins that support it. mcsSprinklers, mcsShelly and mcsMQTT do support it and is documented in their manuals.

    Comment


      #3
      Thank you for the reply. Well understood.

      however and you can keep me honest.. Z-wave plug-in was developed by HomeSeer. So we should expect a documentation? If not then please can you point me to the documentation of Zwave scripting functions specifically for hs.PluginFunction, available functions and parameters.

      Comment


        #4
        As Michael pointed out, this is at the decision of the PI author and as far as I know, there are no Zwave script functions. Few PI authors support this interface, Michael being one of them. In HS2, I had documented most of the MusicAPI functions, it was standardized by HS2 anyway, I decided not to support it anymore in HS3 nor HS4. Having that said, if you import the .exe in say Visual Studio, you can see all the public functions and I do have users out there that do direct calls but they acknowledge that if I make a change, their scripts could break. We PI authors try as much as possible to provide all functions via either HS devices or via actions. I acknowledge that more sophisticated users like to augment their HA projects using scripting, personally I don't have the time to go now document all kind of methods and be constrained when you want to make a change to your code in that you need to maintain some form of backwards compatibility on functions you don't even know whether people are using those. Hope that clarifies it a little more what this really does.

        Comment


          #5
          Originally posted by dcorsus View Post
          As Michael pointed out, this is at the decision of the PI author and as far as I know, there are no Zwave script functions. Few PI authors support this interface, Michael being one of them. In HS2, I had documented most of the MusicAPI functions, it was standardized by HS2 anyway, I decided not to support it anymore in HS3 nor HS4. Having that said, if you import the .exe in say Visual Studio, you can see all the public functions and I do have users out there that do direct calls but they acknowledge that if I make a change, their scripts could break. We PI authors try as much as possible to provide all functions via either HS devices or via actions. I acknowledge that more sophisticated users like to augment their HA projects using scripting, personally I don't have the time to go now document all kind of methods and be constrained when you want to make a change to your code in that you need to maintain some form of backwards compatibility on functions you don't even know whether people are using those. Hope that clarifies it a little more what this really does.
          There are a number of zwave ones available that HST has exposed. They are not well documented though, but can be figured out by using Visual Studio. There are also a number of scripts posted in the forum that show examples such as getting and setting parameters.
          HS 3.0.0.548: 1990 Devices 1172 Events
          Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

          Comment


            #6
            Originally posted by sparkman View Post

            There are a number of zwave ones available that HST has exposed. They are not well documented though, but can be figured out by using Visual Studio. There are also a number of scripts posted in the forum that show examples such as getting and setting parameters.
            Are they "exposed" for user use or they are just defined public because it was just easier to code as opposed to enforce strict rules of exposing only what needs exposure. I'm unfortunately of the former, if you take my PI, you'll see a ton of exposed functions but it wasn't my intention for people to use them, I guess that's the point I was making about z-wave that it may not be a documentation issue, they may have had no plans for anyone to muck about directly in their PI.

            Comment


              #7
              Dirk,
              I am sure glad I am able to use hs.pluginfunction("Sonos", "", "SetLinkgroupZoneDestination", {"ANNOUNCE", linkstring}) whether it was intended or not. It is vital to my announcements.

              Comment


                #8
                Originally posted by prsmith777 View Post
                Dirk,
                I am sure glad I am able to use hs.pluginfunction("Sonos", "", "SetLinkgroupZoneDestination", {"ANNOUNCE", linkstring}) whether it was intended or not. It is vital to my announcements.
                Sure you do

                Comment


                  #9
                  Originally posted by dcorsus View Post

                  Are they "exposed" for user use or they are just defined public because it was just easier to code as opposed to enforce strict rules of exposing only what needs exposure. I'm unfortunately of the former, if you take my PI, you'll see a ton of exposed functions but it wasn't my intention for people to use them, I guess that's the point I was making about z-wave that it may not be a documentation issue, they may have had no plans for anyone to muck about directly in their PI.
                  I believe Rich or Rick T had posted examples in the past, so don't think they were against the use of them.
                  HS 3.0.0.548: 1990 Devices 1172 Events
                  Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

                  Comment


                    #10
                    Thank you all for the replies, as @sparkman stated the set and get configurations was mentioned already on other posts.

                    Specifically for the Z-Wave plugin,

                    @dcorsus
                    How can I lookup the public functions in visual studio by importing the .exe? can you please post instructions. Just for my own knowledge and i think many would be interested as well to learn it.

                    I have tried visual studio code but could not get a wrap around the functions for example the
                    Configuration_Set
                    Configuration_Get

                    Thank you.

                    Comment


                      #11
                      Just nudging the experts .
                      How can I lookup the public functions in visual studio by importing the .exe?

                      Comment


                        #12
                        Originally posted by YouElz View Post
                        Just nudging the experts .
                        How can I lookup the public functions in visual studio by importing the .exe?
                        It's been a while since I've done that, I think I found out how to do so in the VS Help or by Googling. VS has an Object Browser, and there's a way to select exe/dll files with it and then you can drill down into the available functions. There's also a search function which helps find things within the exe/dll. Let me know if you can't find it and I can get VS reinstalled (I replaced my system a few months ago and have not reinstalled it yet) to figure out the exact steps.
                        HS 3.0.0.548: 1990 Devices 1172 Events
                        Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

                        Comment


                          #13
                          Thank you for getting back sparkman . I have Visual Studio Code with the ILSpy decomiler.

                          https://marketplace.visualstudio.com...e.ilspy-vscode

                          Maybe I am not looking at the right file or dll. I was able to open the HSPI_Zwave.exe (maybe it is the wrong file I am looking at). However i was not able to locate the public functions. e.g.
                          Configuration_Set
                          Configuration_Get
                          and others..

                          I appreciate you guidance..

                          Click image for larger version

Name:	10.JPG
Views:	113
Size:	83.4 KB
ID:	1391693

                          Comment


                            #14
                            YouElz I reinstalled VS and the functions can be found under HSPI_ZWave, HSPI using the VS object broswer.
                            HS 3.0.0.548: 1990 Devices 1172 Events
                            Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

                            Comment


                              #15
                              sparkman Thank you very much. I was able to find as explained..

                              appreciate your support

                              Comment

                              Working...
                              X