Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 12 12:42
    Build #213 passed
  • Feb 12 12:40
    greenkeeper[bot] commented #110
  • Feb 12 12:40

    greenkeeper[bot] on gulp-shell-0.8.0

    chore(package): update gulp-she… (compare)

  • Dec 20 2019 22:51
    Build #212 passed
  • Dec 20 2019 22:49
    greenkeeper[bot] commented #109
  • Dec 20 2019 22:49

    greenkeeper[bot] on eslint-6.8.0

    chore(package): update eslint t… (compare)

  • Nov 30 2019 19:04
    Build #211 passed
  • Nov 30 2019 19:03
    greenkeeper[bot] commented #109
  • Nov 30 2019 19:02

    greenkeeper[bot] on eslint-6.7.2

    chore(package): update eslint t… (compare)

  • Nov 25 2019 05:13
    Build #210 passed
  • Nov 25 2019 05:11
    greenkeeper[bot] commented #109
  • Nov 25 2019 05:11

    greenkeeper[bot] on eslint-6.7.1

    chore(package): update eslint t… (compare)

  • Nov 22 2019 20:37
    Build #209 passed
  • Nov 22 2019 20:33
    greenkeeper[bot] commented #109
  • Nov 22 2019 20:33

    greenkeeper[bot] on eslint-6.7.0

    chore(package): update eslint t… (compare)

  • Oct 25 2019 20:49
    Build #208 passed
  • Oct 25 2019 20:48
    greenkeeper[bot] commented #109
  • Oct 25 2019 20:47

    greenkeeper[bot] on eslint-6.6.0

    chore(package): update eslint t… (compare)

  • Oct 21 2019 23:38

    alexdresko on master

    unofficial hs3 Merge branch 'master' of https:… (compare)

  • Oct 21 2019 23:31

    alexdresko on master

    Update README.md (compare)

Brandon Grant
@Artiiz-ZA
Hey there.
Just getting started with transitioning a plugin over to use your awesome framework. I have done nothing more than install through Visual Studio and create a project from the template, changed the endpoint in debugging. The issue I am having is the plugin shows up, however the Plug-In Name in HomeSeer Interfaces and Addons is completely blank, where in the getting started guide it showed. Is there an additional required step?
Brandon Grant
@Artiiz-ZA
Turns out it is just HomeSeer being difficult about Remote Connections, my bad!
Alex Dresko
@alexdresko
@Artiiz-ZA Glad you got it working. Let us know if you run into any issues. It probably wouldn't hurt if you read the past couple of pages of content here in gitter. That, along with checking out the most recent opened and closed issues in github will likely help in getting you up to speed.
Brandon Grant
@Artiiz-ZA
@alexdresko Thanks,, will do!
Alex Khassapov
@alexbk66
Turns out it is just HomeSeer being difficult about Remote Connections, my bad!
It's not difficult, you just need to use API properly
HomeSeerAPI.WebPageDesc wpd = new WebPageDesc
{
    plugInName = PluginName,
    link = link,
    linktext = linktext,
    page_title = page_title
};

// Link for "Manage Plugins" page
Callback.RegisterConfigLink(wpd);
// Link for Plugins Menu
wpd.plugInName = PluginNameCleaned;
Callback.RegisterLink(wpd);
Odd Erik Midthaug
@oesolberg
Have any of you gotten PluginFunction to work with arrays of classes? I can get it to work with array of string, but when I try to return a serializable class in an array the calling script gives me an exception (Object reference not set to an instance of an object)
Alex Khassapov
@alexbk66
PluginFunction is designed to return result of function executed inside plugin. You can't return objects allocated inside pluging executable - they belong to plugin memory space.
Odd Erik Midthaug
@oesolberg
I have managed to return an array of strings from my plugin. And I see that BLGData plugin returns an array of CalendarEvents. So it can be done. I am just not sure how.
Alex Khassapov
@alexbk66
Probably strings are native and HS knows how to marshal them.. I'm not sure what BLGData returns, possible also array of strings? Do you realise that plugin is an executable, when you create an object - it allocates it in its own memory - you can't expect to access process memory outside the process space. It's not as trivial, https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dcom/d325327c-4b2c-4096-964e-c596feffd929
Odd Erik Midthaug
@oesolberg
BLGData returns an array of CalendarEvents cast to object before it is sendt back to the calling script. Or at least that is what it looks like when I view his plugin with DotPeek. I am going to try to test this in vb.net (MoskusSample) to see if I can get it to work. If it works in vb.net then it "should" work in C#...
Alex Khassapov
@alexbk66
I tried a test app - HS doesn't understand my object I return, I tried to log just obj.GetType().Name - nothing. Kind of what I was expecting.
However other Blade plugins also return arrays of objects, i.e.
For Each r As Object In hs.PluginFunction("BLOnkyo", "", "Receivers", Nothing) hs.writelog("Info", "Name: " & r.Name & " is a receiver!") Next
So the best option is to ask Blade in forum. You got me interested :)
Alex Khassapov
@alexbk66
One possible explanation - Blade is using VB and you C#?
Odd Erik Midthaug
@oesolberg
Maybe. I will find out later today I think. But VB.Net and C# should produce the same kind of code hence give the same possibilities.
Odd Erik Midthaug
@oesolberg
Nope. Does not work better in VB.Net. Time to enter the messageboard
Alex Khassapov
@alexbk66
I spent two days googling and trying, nothing really helpful. If not Blades plugins - I would say - it's not possible. So Blade is the only hope.
Odd Erik Midthaug
@oesolberg
It is possible. The problem is that we are not seeing the obvious. I guess you are also testing by running the plugin remote. If so HomeSeer will not know about the class you are returning since it is remote. When HS runs the plugin it can inspect the running exe (this is important) and create the needed Serializable classes in the return object.
I got it working!
Odd Erik Midthaug
@oesolberg
And you might need to set all variables in returning object to something.
Not sure yet, but at least I got something working
Odd Erik Midthaug
@oesolberg
Nope, you dont need to set all variables in the returning object. But - IT WORKS ! - yay!
Alex Khassapov
@alexbk66
Yeah, I worked it out too, the exe should be local in HS root - then it can de-serialise the object
Alex Khassapov
@alexbk66
This guy Bill Sobel is pretty annoying
Odd Erik Midthaug
@oesolberg
He has some valid points. I am not familiar with remoting so all that stuff is new to me. Guess I should read up a bit about it.
Alex Khassapov
@alexbk66
You don't really need to understand .NET remoting, just the lessons we learned - which should be really documented. I.e. that HS loads the plugin executable to extract the class declaration using Reflection.
And his comments about sticking to basic objects was not any help - not answering the original question. And the mentoring patronising tone...
Odd Erik Midthaug
@oesolberg
Cool. I will check it out to see if there are any good thoughts I could borrow :-)
Odd Erik Midthaug
@oesolberg
I see that you have linked configs to html-pages. Should not these html-pages exist in the solution?
Alex Khassapov
@alexbk66
I'm not sure what you mean?
And probably HS forum is netter for discussion - so other users can see it.
Odd Erik Midthaug
@oesolberg
RegisterWebPageDesc(Name + " Help", "AKSmartDevice/AKSmartDeviceVer1.htm", "Help1", helplink: true);
RegisterWebPageDesc("Help", "/AKSmartDevice/AKSmartDeviceVer1.htm", "Help2", helplink: false);
Odd Erik Midthaug
@oesolberg
It is not what you do, but the htm-files you are linking to. Should they not be included in the project?
Alex Khassapov
@alexbk66
Ah, yes, they are included in my Smart Device plugin installer. You can try it. http://plugins.homeseer.com/releasenotes?productid=313
Odd Erik Midthaug
@oesolberg
Ah, cool.
Odd Erik Midthaug
@oesolberg
Kudos for making a plugin and adding it to the store.
Alex Khassapov
@alexbk66
Thank you
Odd Erik Midthaug
@oesolberg
Anyone here found out how to have a confirmation dialog to a button in a html page (confirmation dialog when pressing a clsJQuery.jqButton)? Or is there any other way to have a dialog before posting to your plugin?
Alex Khassapov
@alexbk66
I gave-up and just post normally to my plugin when button is pressed - then in my plugin I add a message to my config page (red text) "please press again"
Odd Erik Midthaug
@oesolberg
Haha, I know the feeling. Thanks for the info.
Odd Erik Midthaug
@oesolberg
OK, no response in the forum so I made my own button stealing lots of the original code
Now I check if the return is Submit or Cancel
Alex Khassapov
@alexbk66
Looks good.
Odd Erik Midthaug
@oesolberg
Some adjustments still since I have hard coded a bit too much, but I try to update the gist when I find errors.