Anyone interested in discussing building DIY Home Automation software and hardware?

I'm replying to the original post here, not so much the excellent discussion of DIY hardware.
 
What are you using for software?  I ask because I've been doing the DIY thing, but more on the software side.  I'm cobbling together various parts and controllers, and writing DIY control software for all of it.  The DIY hardware stuff is a bit out of my league, but if you were interested in collaborating on the software side, I'd be all for that.
 
I just read through the docs quickly and have a question:  can plugins be written in VB.NET or are they limited to node.JS?
 
I ask because I have a lot of HAI Omnipro code written in VB.NET that I could potentially leverage to do a plugin for this.
 
Both .NET (c# as well as VB) and Node.JS. There is a different plug-in subsystem for the .NET plugins but they work the same way. There is a working example VB plugin template in the directory 'TestPlugin' in the HAConsole Github directory and is a legacy of the previous version that didn't use Node.JS. Also the event actions can run VB or C# scripts.
 
Although I haven't written up the install instructions, you should be able to simply copy the directories and load it up on Visual Studio, but the plug-in Node.JS manager is still needed even if you don't use Node plugins, as it runs the web server for the client, so you will also need to install Node.JS.
 
I'm trying to implement your system and ran into a few VB errors.  Specifically, I'm trying to build the HAConsole project which is generating the following errors..
 
Error    BC30002    Type 'Commons.Structures.HAMessageStruc' is not defined.    HAConsole    C:\utils\C#\DeanBob\HAConsole\HAConsole\HAUtils.vb    20
Error    BC30002    Type 'Structures.HAMessageStruc' is not defined.    HAConsole    C:\utils\C#\DeanBob\HAConsole\HAConsole\HAServices.vb    54
Error    BC30002    Type 'JsonInclude' is not defined.    Commons    C:\utils\C#\DeanBob\HAConsole\Commons\Commons.vb    45
Error    BC30002    Type 'Structures.HAMessageStruc' is not defined.    HAConsole    C:\utils\C#\DeanBob\HAConsole\HAConsole\HAAutomation.vb    232
Error    BC30002    Type 'HAConst.ShutTypes' is not defined.    HAConsole    C:\utils\C#\DeanBob\HAConsole\HAConsole\HAConsole.vb    13
Error    BC30002    Type 'HAConst.MessLog' is not defined.    HAConsole    C:\utils\C#\DeanBob\HAConsole\HAConsole\HANetwork.vb    257
 
I have installed fastJSON using Nuget. 
 
Unfortunately, I do not have any VB programming experience and would greatly appreciate any assistance offered.
 
Hi Bob,
 
I do need to write up installation instructions as the error is due to not including a common module that is used to share the message structure for dotnet plugins.
 
I'll have a look at this in the morning and make it an easier install (copy & run).
 
Another thing I'd like to do that would be cool is setup a demo site with a demo plugin providing a fake datafeed that the front end widgets can bind with.
 
Also note it works best in IE11 (which is what the front end was developed for - visual studio has integrated debugging with IE). It will work with Edge and Chrome but there are some bugs. Next release will be tested against Edge and Chrome not IE.
 
I was trying to resolve the following error
 
Error    BC30002    Type 'JsonInclude' is not defined.    Commons    C:\utils\C#\DeanBob\HAConsole\Commons\Commons.vb    45
 
I'm trying to resolve the above error.  It appears to me that Jsoninclude is in a jar file entitled  jackson-annotations-2.X.X.jar file. but yet I cannot determine how the jar file is loaded in the VB file. I would assume that a Process.Start method would be used to load the jar file but yet I can't find the method.  Is it possible that I'm incorrectly assuming that a jar file is used in the project?

 
 
Bob, I have made quite a few updates to make for a more robust install and have added quite comprehensive build instructions to the blog on hackaday. Do check the blog and re-clone the HAConsole and PluginMgr repositories and try following the instructions. I did manage to build on a fresh machine and wrote down all the steps needed to get it working. HomePortal.
 
If still stuck post back.
 
I deleted all files and re-cloned the project.  Using MS VS2015, I still encountered the same errors.  So, I again deleted all files and again re-cloned project.  But this second time I used VS2013. Now I only have one unresolvable error..
 
Error    1    Type 'JsonInclude' is not defined.    C:\utils\C#\DeanBob\HAConsole\Commons\Commons.vb    46    10    Commons
 
 
OK I think I know what the problem is, the reference to FastJSON is missing. in Visual Studio Solution Explorer select the Commons project (2nd row from the top) and right click to 'manage nuget packages'. If you don't see PowerJSON in the list (should be the only package) then search for it and install, and re-run.
 
Or reclone HAConsole as I updated the repository.
 
Let me know how you go.
 
PowerJSON was the only package listed.  So, I deleted all files and re-cloned  HAConsole. The first build generated a lot of SQLite errors.  So, I manually added SQLite to the project which resolved all the errors leading to a successful build.  Now, I have the following problem when I run HAConsole....

 
19:08:55.434 [Init]     Starting automation services...
19:08:55.449 [HandleSysErrors]  ERROR NODE.JS Plugin Manager files not found at C:\utils\C#\DeanBob\HAConsole\HAConsole\bin\Debug\..\..\..\..\PluginMgr\PluginMgr. Install Plugin Manager files before continuing. Exiting. Error details below.
System.Exception: No Node Plugin Manager files found
19:08:55.449 [Cleanup]  Shutting down HA Console...
19:08:55.480 [Stop]     WebSockets server failed to stop. Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at HAConsole.HANetwork.NetServices.Stop() in C:\utils\C#\DeanBob\HAConsole\HAConsole\HANetwork.vb:line 107
19:08:55.518 [ShutConsole]      Fatal errors occurred - Server stopped. Press any key to exit console.
 
 
 
Bob, thanks for persevering, getting you working will help me debug the install instructions. Would be easier for install if I package up everything in a zip or installer, the instructions on the hackaday project blog are effectively for a developer deploy.
 
Have you cloned the PluginMgr repository that is sitting at the same directory level as HAConsole (c:\utils\c#\deanbob directory has both HAConsole and PluginMgr directories)? Node.JS runs the web server and other interfaces so is a mandatory dependency (even if you don't want to use Node.JS plugins). Also check to see if the file nodebat.bat exists in c:\utils\c#\deanbob\PluginMgr\PluginMgr directory as the code is checking for the existence of that file.
 
My bad.  I didn't clone the PluginMgr repository.  Now I get the following error...
 
20:14:22.617 [Init]     Starting automation services...
20:14:22.699 [HandleSysErrors]  ERROR Fatal error in loading console log data. Exiting.... Error details below.
System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
   at System.Data.SQLite.SQLite3.StaticIsInitialized() in C:\dev\sqlite\dotnet\System.Data.SQLite\SQLite3.cs:line 2994
   at System.Data.SQLite.SQLiteLog.Initialize() in C:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteLog.cs:line 141
   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework) in C:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteConnection.cs:line 901
   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString) in C:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteConnection.cs:line 815
   at System.Data.SQLite.SQLiteConnection..ctor() in C:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteConnection.cs:line 805
   at HAConsole.HAServices.HomeServices.InitLogDB() in C:\utils\C#\DeanBob\HAConsole\HAConsole\HAServices.vb:line 294
20:14:22.701 [Cleanup]  Shutting down HA Console...
20:14:22.717 [Stop]     WebSockets server failed to stop. Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at HAConsole.HANetwork.NetServices.Stop() in C:\utils\C#\DeanBob\HAConsole\HAConsole\HANetwork.vb:line 107
20:14:29.966 [ShutConsole]      Fatal errors occurred - Server stopped. Press any key to exit console.
I've tried adding SQLite.Interop.dll manually and get the following error.. 
 
A reference to SQLite.Interop.dll could not be added. be sure the file is accessible and that it is a valid assembly or COM component.
 
I think a packaged project in a  zip file or installer would be more preferable.  It would make life a lot easier.
 
OK looks like you might be using a 32 bit version of Windows? Or you need to install SQLite via Nuget - my BIN directory had an old version from a previous Windows build. In the HAConsole project try adding the System.Data.SQLite.Core package (search for SQLite in the Nuget package manager). Also check that you have set the build options to AnyCPU (the Visual Studio project is setup that way on GitHub so shouldn't be a problem but check).
 
It takes me a bit of work to get the build environment setup and documented, thanks for helping me debug. I will look at a zip/installer but not now due to time constraints.
 
I'll try the install again on another machine as there may be other dependencies (the dependency libs won't come down from GitHub but need to be installed via NuGet).
 
Back
Top