The wait is finally over! 
I'm releasing my simple basic plugin sample, so that others can get started with writing plugins and (hopefully) contribute to the sample. I'll be adding elements as I get to them writing my own plugins.
The plugin is based on the samples from HomeSeer Tech, but I've added comments from the SDK and online help (and links to it so that it's easier accessible), I've renamed many variables to make them more compliant with newer naming conventions and make them easier to read and understand what's really going on (I am of course not able to rename classes from HS3, so there's a few strange things like "strTrigActInfo" which is not a string at all). I've also added a few elements to make coding easier (like a custom Settings class and functions to handle Linq on Devices and Events).
The samples and APIs from HomeSeer are really totally awesome! The versatility and integration is quite unique, and that leaves endless possibilities. It's just that I found the samples from HST somewhat confusing to understand, and as there are virtually no comments, it was rather hard to get going. I figured the time I spent on understanding the sample could be put to good use, so that others will save some time.
I've stared a simple FAQ below.
Q: "What does this plugin do?"
A: Nothing very useful, it just does "something" to get you started. Heres a quick summary:
1. It generates a random value every X minutes or seconds (this Is user changeable by a settings page). This is used to show how triggers and conditions work. See the region "Trigger Interface".
2. It generates different types of devices, just to show how that could be done and how the plugin reacts to usage of the different controls (CAPI). See the sub "CheckAndCreateDevices".
3. It shows how text, values and even custom objects can be stored in a device, and how you create your own "Tab" on the device settings. See subs "ConfigDevice" and "ConfigDevicePost".
4. It has a simple settings page that demonstrate how you can update settings for your plugin.
Q: "What do I need?"
A: You need Visual Studio (Visual Studio Community Edition should work just fine), HomeSeer 3 running either locally or on a remote computer, some spare time (the more, the better), and an appetite for coding.
Q: "Where do I start?"
A: 1. Copy "HomeSeerAPI.dll", "HSCF.dll" and "Scheduler.dll" from your HS3 dir to into the dir of this project (extract the zip file first, of course).
2. Just start HS3 if its not running, and hit Debug in Visual Studio. Then youll see whats going on
3. Do some customization, I suggest start by naming your plugin. this is done several places:
a. In "utils.vb", see variables "IFACE_NAME" and "INIFILE".
b. See in "My Project" in the Solution, and change both
c. If you, like me, dont want the solution and project named "MoskusSample" you can edit the .vbproj and .sln files in notepad (but close Visual Studio first).
4. Then look into the "Plugin.vb" file. A good place like any other is to start by finding the sub "InitIO", whats where the plugin is initialized.
5. However, if you REALLY want to dive right in to it, find the "UpdateTimerTrigger" sub and read to the end.
Here's a screenshot of the devices the plugin creates:

The sample demonstrates a few different methods for creating devices and how to handle input and output of data.
Here's a screenshot of Event triggers and actions:

The sample has two Triggers. One without subtriggers and one with. Both can be used as a condition. See Enums "TriggerTypes" and "SubTriggerTypes" which I've added to make "(int) TrigInfo.TANumber" and "(int) TrigInfo.SubTANumber" more understandable.
I've just added one action, but most of the same logic applies also applies to actions.
This sample doesn't magically make writing plugins super easy. It still requires some time to understand how it is pieced together. But hopefully it will get you started.
If you know what you are doing and have comments of what I can do better, then please feel free to let me know. Share code if you can.
What is missing at the moment:
And last:
If you want, you can always "tip" me via Paypal to "moskus a_t gmail d_o_t com" (where "a_t" = "@" and "d_o_t" = "."). It is not expected or required, but highly appreciated.
Download in the next post.
I've written a basic "Getting Started" post here.

I'm releasing my simple basic plugin sample, so that others can get started with writing plugins and (hopefully) contribute to the sample. I'll be adding elements as I get to them writing my own plugins.

The plugin is based on the samples from HomeSeer Tech, but I've added comments from the SDK and online help (and links to it so that it's easier accessible), I've renamed many variables to make them more compliant with newer naming conventions and make them easier to read and understand what's really going on (I am of course not able to rename classes from HS3, so there's a few strange things like "strTrigActInfo" which is not a string at all). I've also added a few elements to make coding easier (like a custom Settings class and functions to handle Linq on Devices and Events).
The samples and APIs from HomeSeer are really totally awesome! The versatility and integration is quite unique, and that leaves endless possibilities. It's just that I found the samples from HST somewhat confusing to understand, and as there are virtually no comments, it was rather hard to get going. I figured the time I spent on understanding the sample could be put to good use, so that others will save some time.
I've stared a simple FAQ below.
Q: "What does this plugin do?"
A: Nothing very useful, it just does "something" to get you started. Heres a quick summary:
1. It generates a random value every X minutes or seconds (this Is user changeable by a settings page). This is used to show how triggers and conditions work. See the region "Trigger Interface".
2. It generates different types of devices, just to show how that could be done and how the plugin reacts to usage of the different controls (CAPI). See the sub "CheckAndCreateDevices".
3. It shows how text, values and even custom objects can be stored in a device, and how you create your own "Tab" on the device settings. See subs "ConfigDevice" and "ConfigDevicePost".
4. It has a simple settings page that demonstrate how you can update settings for your plugin.
Q: "What do I need?"
A: You need Visual Studio (Visual Studio Community Edition should work just fine), HomeSeer 3 running either locally or on a remote computer, some spare time (the more, the better), and an appetite for coding.
Q: "Where do I start?"
A: 1. Copy "HomeSeerAPI.dll", "HSCF.dll" and "Scheduler.dll" from your HS3 dir to into the dir of this project (extract the zip file first, of course).
2. Just start HS3 if its not running, and hit Debug in Visual Studio. Then youll see whats going on
3. Do some customization, I suggest start by naming your plugin. this is done several places:
a. In "utils.vb", see variables "IFACE_NAME" and "INIFILE".
b. See in "My Project" in the Solution, and change both
c. If you, like me, dont want the solution and project named "MoskusSample" you can edit the .vbproj and .sln files in notepad (but close Visual Studio first).
4. Then look into the "Plugin.vb" file. A good place like any other is to start by finding the sub "InitIO", whats where the plugin is initialized.
5. However, if you REALLY want to dive right in to it, find the "UpdateTimerTrigger" sub and read to the end.
Here's a screenshot of the devices the plugin creates:

The sample demonstrates a few different methods for creating devices and how to handle input and output of data.
Here's a screenshot of Event triggers and actions:

The sample has two Triggers. One without subtriggers and one with. Both can be used as a condition. See Enums "TriggerTypes" and "SubTriggerTypes" which I've added to make "(int) TrigInfo.TANumber" and "(int) TrigInfo.SubTANumber" more understandable.
I've just added one action, but most of the same logic applies also applies to actions.
This sample doesn't magically make writing plugins super easy. It still requires some time to understand how it is pieced together. But hopefully it will get you started.
If you know what you are doing and have comments of what I can do better, then please feel free to let me know. Share code if you can.
What is missing at the moment:
- Public plugin functions
- Public property get/set
- Proper documentation for web page building (I'm not done yet)
And last:
If you want, you can always "tip" me via Paypal to "moskus a_t gmail d_o_t com" (where "a_t" = "@" and "d_o_t" = "."). It is not expected or required, but highly appreciated.

Download in the next post.
I've written a basic "Getting Started" post here.
Comment