Originally posted by jeubanks
View Post
Announcement
Collapse
No announcement yet.
HSPI_MoskusSample - An easier plugin sample [VB.NET]
Collapse
X
-
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"!
-
Just wanted to add my thanks (and a donation to you) for sharing this with us. This took me from zero to having a working plug-in in just a day or so. I've written a lot of software but this helped get me over the hurdle of understanding the basics of how the plugin interfaces work. Thank you, thank you, thank you. And look for a contribution in your inbox soon.
Comment
-
Originally posted by XboxMeister View PostJust wanted to add my thanks (and a donation to you) for sharing this with us. This took me from zero to having a working plug-in in just a day or so. I've written a lot of software but this helped get me over the hurdle of understanding the basics of how the plugin interfaces work. Thank you, thank you, thank you. And look for a contribution in your inbox soon.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
-
One suggestion I have for this sample is in the example devices it creates. Right now it creates a root device and associates child devices to it. All good so far. The plug-in I am building needed multiple roots with their own set of child devices under them (each root has the same set of child devices but they are separate objects in the end to support multiple instances of root objects).
One thing I needed to do was figure out if the root tied to a given child was the one I was looking for. But when I call GetParentRefByRef() on a child, it kept returning 0 rather than a value RefID. I just figured out last night that the association has to be done in both directions (parent associated to child, child associated to parent). Right now the sample just does the first part with a line like the following after creating a child object:
If childDeviceReference > 0 Then root.AssociatedDevice_Add(hs, childDeviceReference)
This only adds the child to the parent's list of associated devices but for whatever reason HS doesn't add the parent to the child device's associated device list when you do this. So I added a second AssociatedDevice_Add() line that basically made the reverse connection and now all works as I need it to.
Maybe there is a reason why the sample shouldn't do this as a standard practice? I'm still learning about all this stuff so perhaps the parent->child association is far more typical but it took me a while to figure out why GetParentRefByRef() kept failing. Is it better to have plugins handle this sort of thing in a separate instance of the plug-in vs. having the plug-in handle multiple root devices? It would probably make my code a lot simpler if I had separate plug-in instances but I haven't figured out how to do that yet and I don't think I've seen a plug-in actually run multiple instances yet in my HS3 plug-in page.
Feedback on this?
Still love this sample. It has really gotten me going. I have several plug-ins under development using it already. :-)
Comment
-
Originally posted by XboxMeister View PostFeedback on this?
HomeSeer Tech has changed something in the way it handles the parent/child-relationship. Now you need to add both, and also after a call to hs.SaveDevicesEvents().
There are a couple of other bugs in the sample I need to update. It is overdue for an update, as I also have learned alot after creating this sample.
Originally posted by XboxMeister View PostStill love this sample. It has really gotten me going. I have several plug-ins under development using it already. :-)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
-
Originally posted by Moskus View PostYes, I'm guessing you are using a beta version of HS3 higher than .435. Am I right?
HomeSeer Tech has changed something in the way it handles the parent/child-relationship. Now you need to add both, and also after a call to hs.SaveDevicesEvents().
There are a couple of other bugs in the sample I need to update. It is overdue for an update, as I also have learned alot after creating this sample.
Thanks! The intention was to make plugin creation much simpler. I hope I have achieved that.
You definitely achieved your goal. As I said, I have a few PIs underway right now thanks to your sample. Many thanks!
Comment
-
Problem with utility "log" in Moskus Sample. When attempting to use LogType.Debug, it errors out with the message below. All other LogTypes work fine. My code is:
Log("Plugin.vb -> InitIO", LogType.Debug) Any ideas as to how to fix?Thanks!Initializing plug-in(2): MoskusSample Instance::Object reference not set to an instance of an object.STACK: Server stack trace: Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessag e(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(Mess ageData& msgData, Int32 type) at HomeSeerAPI.IPlugInAPI.InitIO(String port) at Scheduler.clsHSPI.CheckInterfaces() Fred
HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call
Comment
-
Moskus,
Is there a chance that you might be creating a C# version of your sample using the HSPI framework? That would be a great way for us newbies to compare developing on the two languages!Fred
HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call
Comment
-
Originally posted by ITguyHS View PostMoskus,
Is there a chance that you might be creating a C# version of your sample using the HSPI framework? That would be a great way for us newbies to compare developing on the two languages!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
-
Originally posted by Moskus View PostFred
HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call
Comment
-
Originally posted by ITguyHS View Post
How in the world did I miss that? Thank you!!!
I'm actually not the one who as translated it, but Guahtdim has done 99.98% of it so he should be the one to thank. I've just verified that it does what the VB.net version does, and my next plugin will be in C#.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
-
Originally posted by ITguyHS View Post
Is there an existing thread for questions and bugs for HSPI_CsharpSample? The github download won't build.
I had no problems building it myself....? Visual Studio 2017.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
-
Originally posted by Moskus View Post
No, no existing thread. But it is on Github...
I had no problems building it myself....? Visual Studio 2017.Fred
HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call
Comment
Comment