Announcement
Collapse
No announcement yet.
HSPI_MoskusSample - An easier plugin sample [VB.NET]
Collapse
X
-
I'm guessing you already had it running in the background when you started debugging. I've done that more times than I want to admit...
-
Web config and status not working with new plugin name.
I have modified MoskusSample with a new plugin name. In MoskusSample HS calls GetPagePlugin to populate the web pages with content, my renamed plugin does not.
Hs.RegisterPage is called as it should be with same parameters as in MoskusSample, but with new Link and Plugin_name.
The web pages open with correct URL when pushing the status or config button, but is not populated as ​GetPagePlugin is not called.
Any suggestion on where to look is appreciated.
EDIT
The fun about programming: One day later it works without me changing any code. Just leave the ghosts for some time and the will get bored...
Leave a comment:
-
Originally posted by Moskus View PostWell, if it's a child device then are you certain that the Device_Type_String contains "Basic"?
Leave a comment:
-
Well, if it's a child device then are you certain that the Device_Type_String contains "Basic"?
Leave a 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?
Leave a comment:
-
Originally posted by Guahtdim View PostThank you . I will update the C# version as soon as possible.
Leave a comment:
-
Very much so! Saved me a lot of frustrating hours of trying to figure out what was broken.
Leave a 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
Leave a 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
Leave a comment:
-
Also 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
- Likes 2
Leave a 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
Leave a 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
Leave a 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 ;-)
Leave a comment:
Leave a comment: