Originally posted by Simplex Technology
View Post
Announcement
Collapse
No announcement yet.
Yet another HSPI plugin library
Collapse
X
-
- Likes 1
-
Originally posted by alexbk66 View PostYeah, exactly, I didn't mean . I mean HST should respect their paying customers a bit more.It was a painful process trying to work out all bits and pieces. Unnecessary long and painful. It could be more pleasant if SDK itself was more "user friendly", then you don't really need documentation....
- Likes 1
Comment
-
I moved repository to Bitbucket, including a few improvements:
https://bitbucket.org/_alexbk66/hspi...te/src/master/
Comment
-
Originally posted by alexbk66 View PostI moved repository to Bitbucket, including a few improvements:
https://bitbucket.org/_alexbk66/hspi...te/src/master/
I've been going through your example and it's nicely done. I only see in the Devicebase a method for a "basic" device with no further reference for a device with options "advanced" or for paraent/child devices. Was the current idea to provide the base and then it can be extended through the plugin? I'm still wrapping my head around C# so I'm being a little slow/dense.
Comment
-
Originally posted by Simplex Technology View PostI've been going through your example and it's nicely done. I only see in the Devicebase a method for a "basic" device with no further reference for a device with options "advanced" or for paraent/child devices. Was the current idea to provide the base and then it can be extended through the plugin? I'm still wrapping my head around C# so I'm being a little slow/dense.
And in this version I added functions for parent/child relations, and more methods for creating VSPairs.
And more helpers in PageBuilder class, i.e. TableObjectProperties function for displaying object properties in a table
Code:public string BuildTable(NeoHub hub) { var table = new TableBuilder($"NeoHub configuration dump", ncols: 2, page_name: PageName, tableID: "table_info", inSlider: false ); TableObjectProperties(hub, table); if(hub!=null) TableObjectProperties(hub.system, table); return table.Build(); }
Comment
-
Example creating a device derived from DeviceBase:
Code:public override bool Create() { bool created = Create($"NeoStatFloorTemp-{zone}", force: false, type: "akHeatmiserNEO Floor Temp", Device_API: DeviceTypeInfo_m.DeviceTypeInfo.eDeviceAPI.Thermostat, Device_Type: (int)DeviceTypeInfo_m.DeviceTypeInfo.eDeviceType_Thermostat.Temperature, Device_SubType: (int)DeviceSubtype.stat_floortemp, Device_SubType_Description: "NeoStat Floor Temperature" ); if (created) { AddVSPair((double)HubControlStates.NotConnected , "Not Connected" , ePairControlUse.Not_Specified , "/images/HomeSeer/status/unknown.png" , Status_Control: ePairStatusControl.Status ); AddVSTemperaturePair( hub.TempFormat == TempFormat.C, hub.MinTemp, hub.MaxTemp, RangeStatusDecimals: 1, Status_Control: ePairStatusControl.Status ); } return created; }
Comment
-
And example of creating a child device from parent:
Code:setTempDevice = new NeoStatSetTempDevice(controller as Controller, hub, zone, stat); setTempDevice.SetParent(this);
Code:public bool log_enable { get { return GetPED<bool>(Utils.FuncName()); } set { SavePED(Utils.FuncName(), value); } }
Comment
-
alexbk66 and
OK, thanks to your efforts and these recent PI discussions, I'm convinced that writing a plugin is in my future. There are a couple of use cases related to solar power and EV charging that will make it worth the time.
Can someone tell me what is needed to set up a windows dev environment?
Thanks in advance.
Comment
-
Originally posted by logbuilder View Post
Can someone tell me what is needed to set up a windows dev environment?-Wade
Comment
-
-
Originally posted by cc4005 View PostIf you haven't seen it yet, jeanv has posted some great beginner tutorial videos.
Using my template all you need is
1. VisualStudio 2017 (i.e. Express if you want free).
2. Download my code
3. You need set references to HS dlls (HomeSeerAPI.dll, HSCF.dll and Scheduler.dll) - either copy them from your HS installation to the project root, or set project references to point to the dll locations.
4. and it should compile and run.
Just need make changes related to your plugin (things that Alex Dresko automated in his template):
1. rename the project,
2. adjust AssemblyInfo.cs, i.e. AssemblyTitle, AssemblyProduct
3. change project settings, i.e. "Assembly name" and "Default namespace"
4. and finally change the plugin name in HSPI.cs GetName() function
- Likes 1
Comment
-
Originally posted by alexbk66 View PostI made a few improvements includingCode:this.pageCommands.Add("starttimer", "")
Comment
Comment