Close

Rebuild Server to .NET Core with improvements

A project log for HomePortal

Home Automation software hub that unifies home sensors and cloud services with a flexible and easy to use browser interface

deandobdeandob 03/04/2017 at 06:450 Comments

I am doing a major re-write of the server code for the HomePortal automation system.

The new version will have the following (most architectural) features:

1) Written in C# instead of VB.NET. No real benefit to be gained in swapping languages except that C# is a better supported language, and as I also write in C and JavaScript it is easier to jump between languages. Although I think VB is an expressive language, I do find C# enjoyable to

2) Using the new Microsoft .NET Core open source technologies. This will make the solution truly portable across different operating systems easily and being open source makes .NET (and solutions like HomePortal) accessible to a wider audience. This will be the first (significant) .NET Core home automation system available.

3) Using modern frameworks. The VB version is around 5 years old when there wasn't frameworks like Entity Framework and logging frameworks that the new .NET Core HomePortal version is using. I expect to retire about 50% of the codebase due to this, and it will be easier to maintain, faster and more accessible to others who may want to extend the solution.

4) More consistent use of design patterns like PubSub, MVC and plugin architectures. The extensibility of the solution is significantly improved (eg. to add another plugin language like Python) by adding more features through 'Extensions' which are .NET Core DLLs that can be added to the main program and bound at runtime. It will also be possible to replace the default functionality with your own (eg. a different rules engine) by dropping in a new rules DLL.The plugins are even simpler to use, with pub/sub interfaces and are compiled at startup and the code will be editable in the client.

5) Integrated security. The VB.NET version does not have security built in, and the new Core version has a security authorization / authentication layer in the subscribe function that controls the access to channels.

6) MQTT pub/sub for browser access (still via websockets) with a simpler and more consistent implementation. REST and Sockets interfaces will remain and additional interfaces can be added via extensions as the event driven architecture is consistently accessed vis publish/subscribe.

7) Not for the initial release but the next version will have Iotivity support (for device discovery and taxonomies), voice support (Cortana skills) and AI using LUIS cognitive services and Bots.

8) Use of InfluxDB as the timeseries message store, which should speed up queries and history requests (for graphing) as well as provide additional history functionality applicable to timeseries datasets (ie. recording sensor events)

The VB.NET version has a lot of functionality to be ported, however I do think the effort will be worth it as the solution will be faster, more reliable and more extensible. I will do a proper open source launch when it is completed (ETA 2 months - I'm about 40% through the porting).

You can see the work in progress in my GitHub folders: https://github.com/deandob/HAServer

If you have any feedback or ideas about the new version, do post comments.

Discussions