Monday, September 7, 2020

Graphs.

 Graphs.

The weather module and the electricity consumption metering module constantly send data to the server.

We can use this data to build graphs. The system records temperature, humidity, lighting and electricity consumption. You can also set the cost per kilowatt of electricity in the configuration, and the cost for the current month will be displayed on the graph page.





Sunday, September 6, 2020

Creation of a new device.

 Creation of a new device.


The idea of my system is simplicity, reliability, availability and low cost.

Therefore, creating devices on my system is very easy, in three steps:

- come up with a device and describe the logic of work;

- create a model of the device with incoming and outgoing data;

- create a program for the device.

It was difficult for me to create the first device, all the others have a more or less general pattern, only the executive functions change.



Checking the system for operability.

Checking the system for operability.


A health poll takes place between the device and the Server once every two minutes.

If the device does not receive a request from the server (ping) within 2 minutes, it will turn off. 

This is important in devices that control high power loads such as heaters. 

If the Server does not receive a response from the device within two minutes, it marks the device in red and stops sending any commands except for a ping. This function is triggered via the crontab on Server side.



Description of the idea.

 Description of the idea.


 For many years, I have been thinking about the concept of a Smart Home. 

I have seen many systems and devices, expensive and cheap. 

All of these systems and devices, in general, is a lighting control consoles and some other devices.

Almost all of these systems are able to control the room temperature.

In these systems, I saw not much "SMART" ...

All these systems and devices are very expensive. Nowadays there are many cheap devices that can and should be used.

Arduino and ESP8266 boards, for me, are the ideal option in terms of functionality and price.

In small and home automation, it makes no sense to use boards with a lot of functions and outputs/inputs.

The price for one board does not exceed 5 Euro, plus a mini power supply unit, plus 1, 2 relays, and the total cost does not exceed 15 Euro.

Yes, I considered the most expensive option, plus I constructed everything by myself.


I think the system that I created has more chances to be called "SMART".

The main device in my system is a Linux server with Apache, PHP, MySQL.

At the moment, all my devices are made on the basis of the ESP8266 and communicate via Wi-Fi with the Server.

To date, I have made only a few models of devices, "Power Meter","Light Control", "Weather Logger", "Access Control", 

"I/O Module", "Windows Close/Open".

Tell me that there are such devices in any system ...

Yes there is. But not these devices make my system "SMART".

All work, all logic is processed by the Server. And there are no limits.


My system works like this.

To create a device, it is necessary to describe the device model, that is, incoming and outgoing data.

A device model is a database record describing functions and codes that can be sent to or from a device.



The device must understand these codes and perform the appropriate actions that are specified by the programmer.
In turn, the device sends a response to the Server, this response is analyzed and the logic actions specified by the user are executed.
For example:
- if the lighting level drops to X -> turn on the light;
- if electricity consumption has exceeded the set limit -> send notification.

I have Ubiquiti Wi-Fi antennas at home, which are controlled by the controller.
And I also used this in my system, where there are users with different parameters and rights.
Among the parameters is the IP address of the mobile phone. 
My system, through the API, constantly checks the number of users in the house and can perform any actions depending on the number of users.

Thus, this system is capable of many things. For example, knowing that there are no users at home and the water meter has started counting, system can decide that there is a leak in the house and shut off the water.

Next, I will describe the system in detail and post a photo with examples.
My goal is to find interested people who could invest in my idea, because this system can be very useful not only in the home.