📜 ⬆️ ⬇️

My smart home on .NET

Recently, on Habré a lot of articles about smart home. Basically, they all relate to interaction with home devices. For automatic decision-making use MajorDoMo , Ninja Blocks or own bicycles.

For about a year I have been writing yet another home automation scripting system. Those. It allows you to hang arbitrary logic on various home events. I offer it to your strict court.
Description and distribution

In my opinion, the system has a rather successful architecture and, using the plug-in mechanism, easily integrates with any hardware. For example, I tried to write plug-ins to control the light through nooLite and to work with an IP camera — it's really simple (see the documentation ). Scripts are written in Java Script (via Web UI), the system itself is written in .NET (I posted the source code on github ).

I don’t think that I can make money this way, but I already got a lot of pleasure working on this project. I am writing here, hoping that you will try to use the system and give me feedback (and if someone likes it and wants to participate in its development, I will be just happy :)
')
Thanks for attention!

UPD. System architecture
image

UPD. Sample Script
Scripts are written in the Java Script language ( do you still not like JavaScript? ). Connected plugins are available from scripts. You can write your plugin and call its commands from scripts.
For example, this is how you can take a picture of the visitor's IP camera, which came while you were not at home (hang this script at the touch of a doorbell button).

var camera = host.getPlugin("DCS933"); // DCS933 -      D-Link DCS-933 var bytes = camera.executeMethod("getCurrentImage"); host.getPlugin("email").executeMethod("send", "myemail@gmail.com", " !", "", bytes); 


UPD. Devices
First of all, I wanted to write a system for automatic decision making (according to scenarios), so it is not tied to any specific hardware. The system has a plugin mechanism (works with MEF). With it, you can connect almost any device with which a computer can interact (including self-made).
I wrote plugins for working with nooLite and D-Link DCS-933 IP cameras (these plugins are among the basic ones). But they were written, first of all, in order to feel for yourself whether it is difficult to write plugins for the system. I tried to write detailed documentation on how to write my own plugins. If you have any questions or difficulties with the integration with iron, write to me (for example, through Habr).

UPD. Project development plans?
What is now on the site is the first version of the system that can be used. There are now only basic plugins and extremely poor UI. Before the summer I plan to rework strongly UI (combine the web application with the service, and do something like a small CMS to customize the home control panel). I also plan to expand the list of standard plugins. There will definitely be plug-ins with alarms, weather forecasts and voice command processing (through the Microsoft Speech API, it works locally, the recognition quality is pretty good). And there will be installation of plug-ins via the Internet from the gallery of plug-ins (this has already been done, it works through nuget, it remains to raise the site with the gallery of plug-ins).
If you need any other features, please write in the comments.

Source: https://habr.com/ru/post/214387/


All Articles