Announcement

Collapse
No announcement yet.

Really simple C# sample plugin available here!

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

    #16
    Got tired of talking about it and did it.

    First, I created https://github.com/alexdresko/HomeSeerNuget. This repo creates a nuget package (https://www.nuget.org/packages/Homeseer/) which is used by the next repo. It's basically just HomeSeerAPI.DLL, HSCF.dll, and Scheduler.dll. Prevents from having to install HomeSeer just to do HomeSeer development. It is the latest version of those assemblies as of this writing.

    https://github.com/alexdresko/HSPI basically contains the original code that was posted in this thread. From here, we can work it however we want. Personally, I think we should break out the tester into its own nuget package, and then create a base, abstract plugin from the HSPI.cs class.

    Please make your way to the two repos and let's begin some conversation about it all.

    Comment


      #17
      i have started college and cant wait till i get to the C# part!!!!!!!! then yall gonna hate me!!!!!!!
      HW - i5 4570T @2.9ghz runs @11w | 8gb ram | 128gb ssd OS - Win10 x64

      HS - HS3 Pro Edition 3.0.0.435

      Plugins - BLRF 2.0.94.0 | Concord 4 3.1.13.10 | HSBuddy 3.9.605.5 | HSTouch Server 3.0.0.68 | RFXCOM 30.0.0.36 | X10 3.0.0.36 | Z-Wave 3.0.1.190

      Hardware - EdgePort/4 DB9 Serial | RFXCOM 433MHz USB Transceiver | Superbus 2000 for Concord 4 | TI103 X-10 Interface | WGL Designs W800 RF | Z-Net Z-Wave Interface

      Comment


        #18
        Maybe an opportunity to leverage some of this work.....
        https://forums.homeseer.com/showthread.php?t=184086

        I've been trying to move my plugin to use this HSPIBase.cs and the pagebuilder.cs --- both are quite useful
        HS3 Pro Edition 3.0.0.435 (Windows 10 vmware)
        BLOccupied:,UltraNetCam3:,weatherXML:,RFXCOM:,Current Cost 3P:,UltraGCIR3:
        DMMQTT:,Kodi:,Z-Wave:,BLRadar:,EasyTrigger:,MySensors:,BLBackup:

        Comment


          #19
          UPDATE: Long story short: **YOU MAY HAVE TO UNINSTALL THE OLD PLUGIN AND INSTALL THE NEW PLUGIN TO CONTINUE GETTING UPDATES** I thought I configured the original extension incorrectly in the Visual Studio marketplace, and Microsoft doesn't provide a way to change the setting I thought I messed up. So I removed the old extension from the gallery. That's why you get a 404 when you to go https://marketplace.visualstudio.com...eSeerTemplates. The new location's forever home is at https://marketplace.visualstudio.com/items?itemName=thealexdresko.HomeSeerTemplates2 (arrrggg). I'm pretty frustrated by the whole experience and -- worse -- it doesn't even look like the setting makes a difference. I'm trying to automate publishing of the VSIX to the marketplace from the CI build, but I just don't think it's possible anymore.

          ---

          Here's what I did today: https://github.com/alexdresko/hspi is now a utility library used to assist with HomeSeer development. It's based on the original code in this thread, but has been converted into a nuget package.

          I then created a Visual Studio template that uses the HSPI nuget package (and the aforementioned HomeSeer nuget package) to get a developer up to speed quickly.

          The template was packaged as a VSIX and uploaded to the Visual Studio Marketplace. You can therefore install the template from directly within Visual Studio. Go to "Tools > Extensions & Updates" then search for "Homeseer". OR just go to https://marketplace.visualstudio.com/items?itemName=thealexdresko.HomeSeerTemplates2 (I'm writing this before the extension has been indexed into the Marketplace, and I don't know how long it will take)

          Once installed, you can "File > Add new project" and create a "HSPIPluginA" project (I wasn't sure what to call the template just yet, especially since dmurphy recommended another template in the forums). Once the project is created, you should be able to F5 in VS immediately and the console will connect to HS (assuming HS is on 127.0.0.1 using the default port).

          It works great in my tests, but there's still a lot I can think of to do. The nice thing is that we can add/fix things in the HSPI nuget package and everyone will benefit.

          Honestly, I'm fairly proud of what I accomplished on this today. Please let me know what you think so I don't feel like it was a waste of time.

          Also, thanks for the tip dmurphy. I'll look at incorporating that soon.
          Last edited by alexdresko; November 6, 2018, 06:57 PM.

          Comment


            #20
            Love this, but I couldn't get it installed.
            When I searched in VS marketplace it didn't find anything on homeseer.
            When I manually downloaded it, and tried to install it says: "This extension is not installable on any currently installed products".

            I'm running VS 2017RC...

            Comment


              #21
              Originally posted by MrMxyzptlk View Post
              Love this, but I couldn't get it installed.
              When I searched in VS marketplace it didn't find anything on homeseer.
              When I manually downloaded it, and tried to install it says: "This extension is not installable on any currently installed products".

              I'm running VS 2017RC...
              Good find. I created https://github.com/alexdresko/HSPI/issues/21 to track the issue and marked it high priority in the current milestone.

              For anyone else paying attention, the current milestone, called "Good enough to use" has had a couple enhancements since my last post here. https://github.com/alexdresko/HSPI/milestone/1?closed=1

              And here's what's left in the current milestone: https://github.com/alexdresko/HSPI/milestone/1

              It's coming along very nicely.

              Comment


                #22
                Working great! 2 notes, when in VS and you click on 'more info' for your template, the URL you have is non existent...404.

                If you manually look through all of the VS templates (100's), that are installed, the HSPI template does not show up? Maybe I missed it? I had to type HSPI in the search box for installed templates to find it...may be me...maybe not?

                Thanks once again, looking forward to your updates.

                Here is a pic of it running in HS3...

                https://dl.dropboxusercontent.com/u/...e%20Plugin.PNG

                Comment


                  #23
                  Originally posted by MrMxyzptlk View Post
                  Working great! 2 notes, when in VS and you click on 'more info' for your template, the URL you have is non existent...404.

                  If you manually look through all of the VS templates (100's), that are installed, the HSPI template does not show up? Maybe I missed it? I had to type HSPI in the search box for installed templates to find it...may be me...maybe not?

                  Thanks once again, looking forward to your updates.

                  Here is a pic of it running in HS3...

                  https://dl.dropboxusercontent.com/u/...e%20Plugin.PNG
                  https://github.com/alexdresko/HSPI/issues/24https://github.com/alexdresko/HSPI/issues/25

                  Comment


                    #24
                    Originally posted by MrMxyzptlk View Post
                    Working great! 2 notes, when in VS and you click on 'more info' for your template, the URL you have is non existent...404.

                    If you manually look through all of the VS templates (100's), that are installed, the HSPI template does not show up? Maybe I missed it? I had to type HSPI in the search box for installed templates to find it...may be me...maybe not?
                    ]
                    Updated to include a TON of fixes and enhancements, including the suggestion by dmurphy. There's now a second template called HSPIPluginB that integrates the base class from https://forums.homeseer.com/showthread.php?t=184086. PageBuilder is also included in HSPI.

                    See https://github.com/alexdresko/HSPI/milestone/1?closed=1

                    Comment


                      #25
                      Hi all, origonal author here. Sorry for the late response, I haven't had to develop any new code for Homeseer for a while and this all dropped off my radar.

                      Big thanks to all of you (especially alexdresko) who carried this forward with improvements and a Github repository. I probably don't have any more to contribute, you've well surpassed my skills. Well done mate.

                      Comment


                        #26
                        I found the templates in VS and installed them. I then created a new project using the HSPIPluginA template. However, there is no HSPIBase so the HSPI that extends it is full of errors.

                        Am I missing something?

                        Comment


                          #27
                          Originally posted by sirmeili View Post
                          I found the templates in VS and installed them. I then created a new project using the HSPIPluginA template. However, there is no HSPIBase so the HSPI that extends it is full of errors.

                          Am I missing something?
                          I've used HSPIPluginB and it works. However my homeseer system is not my development system. I've tried sending in my server IP in the command line arguments, but yet it still tries to use 127.0.0.1. Is there a way to override this? I've verified that the args[0] is populated by dumping it to the console and I even sent in the port in args[1] as well and it's working, but no matter what, the connector defaults to 127.0.0.1:10400.

                          BTW, Thank you. having a community driven base to create plugins off of will be awesome for those of us just starting out developing plugins for homeseer.

                          Comment


                            #28
                            Originally posted by sirmeili View Post
                            I've used HSPIPluginB and it works. However my homeseer system is not my development system. I've tried sending in my server IP in the command line arguments, but yet it still tries to use 127.0.0.1. Is there a way to override this? I've verified that the args[0] is populated by dumping it to the console and I even sent in the port in args[1] as well and it's working, but no matter what, the connector defaults to 127.0.0.1:10400.

                            BTW, Thank you. having a community driven base to create plugins off of will be awesome for those of us just starting out developing plugins for homeseer.
                            Sorry for the trouble you're having. This post and the one before it looks like two separate issues. Can you do me a favor, though?

                            For the first issue, can you create an issue in the github repo via https://github.com/alexdresko/hspi/issues

                            For the second issue, can you ask on Stack Overflow via http://stackoverflow.com/questions/ask?tags=HSPI? Make sure the post is tagged with HSPI.

                            That will help with tracking these issues.

                            Comment


                              #29
                              Originally posted by alexdresko View Post
                              Sorry for the trouble you're having. This post and the one before it looks like two separate issues. Can you do me a favor, though?

                              For the first issue, can you create an issue in the github repo via https://github.com/alexdresko/hspi/issues

                              For the second issue, can you ask on Stack Overflow via http://stackoverflow.com/questions/ask?tags=HSPI? Make sure the post is tagged with HSPI.

                              That will help with tracking these issues.
                              For the second issue, I checked the connector.cs code and while it accepts the arguments, it doesn't take them into account. It instead always relies on options.cs, which I don't know how I am to override that or modify it (as it's not in the project). If connector.cs was rewritten to use the arguments sent in instead of the options object ONLY if they were sent in, it wouldn't be an issue.

                              Comment


                                #30
                                Originally posted by sirmeili View Post
                                For the second issue, I checked the connector.cs code and while it accepts the arguments, it doesn't take them into account. It instead always relies on options.cs, which I don't know how I am to override that or modify it (as it's not in the project). If connector.cs was rewritten to use the arguments sent in instead of the options object ONLY if they were sent in, it wouldn't be an issue.
                                Ok, I'm not used to using that options library. I looked it up and I got it to work. I had to do "-s xxx.xxx.xxx.xxx" instead of just "xxx.xxx.xxx.xxx" for the argument. It now works for me

                                I have a plugin I already wrote using the other template on here, I'm going to see what it is like to rewrite it using your templates.

                                Comment

                                Working...
                                X