Originally posted by Guahtdim
View Post
Announcement
Collapse
No announcement yet.
HSPI_MoskusSample - An easier plugin sample [VB.NET]
Collapse
X
-
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
-
Ok, so the delegates must point to static methods, but you can always make the static methods do a push of a message to a static queue and have nonstatic handling of the queue (just juse proper locking when queing and dequeing). This should give you the possibillity to create something in a HomeSeer plugin. Or you could create a subpub (https://kudchikarsk.com/publish-subs...ern-in-csharp/)
Don't give up! There is always a solution given enough time ;-)
Comment
-
Originally posted by Guahtdim View PostOk, so the delegates must point to static methods, but you can always make the static methods do a push of a message to a static queue and have nonstatic handling of the queue (just juse proper locking when queing and dequeing). This should give you the possibillity to create something in a HomeSeer plugin. Or you could create a subpub (https://kudchikarsk.com/publish-subs...ern-in-csharp/)
Don't give up! There is always a solution given enough time ;-)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
-
I found what seems like odd behavior using the Moskus template when it comes to device creation. I've built a couple plug-ins so far with the template and what I am noticing is that when one of them is running, any device I create manually (totally outside the plugin code, just hitting the + sign button the main HS3 web page), creates a device that is associated to one of my plug-ins that's based on the sample. If I disable the plug-ins based on the sample, devices are then created normally, not associated to any plug-in. I thought maybe I had screwed something up using the sample so I went back to the original sample without modifications and ran it. Sure enough, when I manually created a device, it was associated to the plug-in. Screenshot attached showing the device I created is magically associated to the sample plug-in even though it was created entirely outside of it. This is on HS 3.0.0.531 but I am pretty sure I saw this on previous builds and just assumed HS was confused with my development work but it seems very repeatable.
I can't imagine this is normal behavior but I don't know what the plugin could be doing to leave HS in a state like this. It just creates devices but perhaps there is some additional cleanup that has to happen? Having HS create devices tied to a plug-in that doesn't know about them can't be right.
- Likes 1
Comment
-
Originally posted by XboxMeister View PostI found what seems like odd behavior using the Moskus template when it comes to device creation. I've built a couple plug-ins so far with the template and what I am noticing is that when one of them is running, any device I create manually (totally outside the plugin code, just hitting the + sign button the main HS3 web page), creates a device that is associated to one of my plug-ins that's based on the sample. If I disable the plug-ins based on the sample, devices are then created normally, not associated to any plug-in. I thought maybe I had screwed something up using the sample so I went back to the original sample without modifications and ran it. Sure enough, when I manually created a device, it was associated to the plug-in. Screenshot attached showing the device I created is magically associated to the sample plug-in even though it was created entirely outside of it. This is on HS 3.0.0.531 but I am pretty sure I saw this on previous builds and just assumed HS was confused with my development work but it seems very repeatable.
I can't imagine this is normal behavior but I don't know what the plugin could be doing to leave HS in a state like this. It just creates devices but perhaps there is some additional cleanup that has to happen? Having HS create devices tied to a plug-in that doesn't know about them can't be right.
- Likes 2
Comment
-
Thank you, thank you, thank you!!!
SupportsAddDevice() was the culprit. It was returning True. When I set it to False and retried it, manual devices were no longer owned by the plug-in. At least for me in the sample SupportsConfigDeviceAll() was already returning False.
Originally posted by Simplex Technology View PostAlso I think I remember this being set to 'true' in the VB Example which it should not be. AS this lets the plugin override HS3 as if it owns all devices.
SupportsConfigDeviceAll()
Find that method in HSPI and set it to FALSE
Comment
-
Originally posted by XboxMeister View PostThank you, thank you, thank you!!!
SupportsAddDevice() was the culprit. It was returning True. When I set it to False and retried it, manual devices were no longer owned by the plug-in. At least for me in the sample SupportsConfigDeviceAll() was already returning False.
- Likes 2
Comment
-
Yes, that is something I should have changed years ago... sorry!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
-
I'm new to plugins and using Moskussample as a way in to my first project. Thanks for the code, helps a lot. I am playing around with Devices and updating. A strange thing I have noticed is when updating devices is:
This code works fine and updates the device and will also trig events associated with the device:
For Each dev In (From d In devs
Where d.Device_Type_String(hs).Contains("Basic"))
hs.SetDeviceValueByRef(dev.Ref(hs), randomValue, True)
hs.SetDeviceString(dev.Ref(hs), "Last random value: " & randomValue, False)
Next​
But, if the basic device is a Child device it do not update the Device and do not trigger events.
However, if you press F5- screen update after sending the update, the device will show the new value.
Any way to update the child device directly?
Comment
-
Well, if it's a child device then are you certain that the Device_Type_String contains "Basic"?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 PostWell, if it's a child device then are you certain that the Device_Type_String contains "Basic"?
Comment
Comment