Prerequisites D-Home is a home automation software for your smart home. The main element of D-Home is the module. It contains all the attributes and functions for controlling devices or monitoring their status. The software offers developers the ability to write their own modules. You need to have installed Node.js, NPM and MongoDB in your System.
npm install
nodemon server.js
To run this software you need node-v8.12.0 or higher. Android:
pkg install nodejs Code is Running on
- http://localhost:3000/ Arch Linux:
pacman -S nodejs npm macOS usingHomebrew: brew install node Windows Simply download the Windows Installer directly from the nodejs.org web site.
After downloading the project folder, go inside the and folder and install npm packages: locally or globally. Choose which kind of installation to use based on how you want to use the package.
npm install To confirm that
npm install
worked correctly, check to see that anode_modules
directory exists and that it contains a directory for the package(s) you installed.
D-Home offers the user the possibility to add modules written by the user himself. A module is related to a specific device and contains all its attributes and functions. Functions such as on and off, timer and any other function that is supported by the device can be implemented in the module by the user and then be used within the software. The first module present in D-Home developed by me is that related to the Sonoff device and offers the following attributes and functionality: set of standard attributes, discovery function, check availability function, power on and off commands
Each module has standards, ie attributes that must always be present in the modules that a developer will add.
To run the software use the command
node server.js And go to : http://localhost:3000/admin Below is a list of the main features and characteristics of the software.
- Authentication service: each user has the possibility to create his own account through which to access.
- Adding modules: the user can add modules to the software. A module is related only to a type of device and encompasses all its attributes and functions.
- Discovery: the service through which you can examine your home network looking for devices.
- Adding devices: each user will have the possibility to add and configure the devices found through the discovery. Each device can subsequently be controlled via the dashboard.
- Dashboard: Panel fully editable and customizable by the user through which you can add various elements (buttons, switches, sliders, etc. ..) which are associated with the devices that control or monitor them.
Here is the main page: on the left a menu through which you can access all the features of D-Home
Through the software you can register one or more home accounts (for example one for each family member, office etc.) through which you can log, add your own devices and configure your own dashboards.
By accessing the dedicated area through the menu on the left you can check all the devices associated, viewing for each, the name, IP address, MAC address, type and status previously explained.
The software provides the user with a dashboard through which it is possible to monitor the status of the associated devices and through configurable elements, such as switch buttons, to control them. A developer who approaches D-Home also has the opportunity to develop new elements to then go to associate with new devices and new modules developed by him. The main features of the dashboard are the following:
- Add or delete items (buttons and switches).
- Modify the added elements, choosing the name, the location, the device associated with it, the functions supported by the device to be started when interacting with the element.
- Add dashboard.
- Possibility to savethe dashboard.
- Possibility to refresh the dashboard.
- Position the elements to customize the dashboard to your liking. Now let's analyze how it looks graphically
Through this configuration screen the user has the possibility to choose the name of the button and associate it with a previously added device. Once the device has been selected, all the functions in the module related to the device are checked and loaded and the user can choose which one to associate with the button. In the case of a button the associable function is one.
Once launched on a machine all the devices connected to the same subnet have the possibility to visit the public interface of the software, which allows only to view and modify one or more dashboards. It will indeed be possible to run through the public interface:
localhost:3000 :heart_eyes: Thanks