Full home automation in a new building

Three years ago, I began to make my old dream come true - the maximum home automation of an apartment purchased in a new building from scratch. At the same time, the “decoration from the builder” had to be sacrificed to a smart home imageand completely redone, and all the electrics not connected with automation came from a famous Chinese site. I did not need a soldering iron, but I had to look for knowledgeable craftsmen, electricians and carpenters for a long time.


Apartment control panel in February 2020 (Home Assistant)

In this article I’ll talk about the choice of smart home technologies used in the apartment, as well as my wiring diagrams, photos of everything that was done, the resulting electrical panels and configurations of all devices, I will give a link to the github .


The construction of our house is in progress - November 2016

What did I want in 2017?


Since I became the owner of the apartment at the foundation pit stage in 2015, I had the time left before the apartment was commissioned in 2018 to determine exactly what automation technology I was going to use in my apartment and most importantly: what I was going to manage.

I wanted to choose the best option and have the following options:

By electrics:


  • Manage lighting levels in all rooms;
  • Manage lighting depending on the time of year and day;
  • To imitate the presence of the owners (in their absence);
  • To operate electric curtains and blinds;


The resulting apartment control panel based on Home Assistant in 2020 is a mobile version of light control

Energy metering:


  • Organize the collection of readings from all metering devices in a single control panel;

According to the system of audio and video equipment. Multiroom:


  • - ;
  • , ;
  • ;
  • ;
  • ;

:


  • ;
  • ;
  • ;
  • ;
  • , /;


Home Assistant 2020 — -

:


  • Establishment of a signal from surveillance cameras in a multiroom system;


Screenshot of Home Assistant in 2020 - camera and sensors on the doors

By ventilation and air conditioning. Heating system:


  • Manage temperature or humidity in all rooms;
  • Manage ventilation depending on temperature and humidity;


Screenshot of the apartment control panel in 2020 (Home Assistant)

According to the weather monitoring system:


  • Collection of meteorological information inside and outside the house (temperature, humidity, wind, atm. Pressure);
  • To reflect the necessary information on visualization devices;

According to the cold and hot water supply system:


  • Information about leaks and their localization;

The list was impressive, but I wanted to have every item.

By wire or by air?


Theoretically, in 2017 there were no problems with the choice of “smart home” technology. Here is the report of one of the European manufacturers:


Image from the 2017 report - technologies used in smart homes

I want to note that by 2017 I had five years of experience in smart homes, starting with the specialized Z-Wave standard, which does not require additional wires and repair work, and ending with an affordable wired MegaD-328 actuator, which cannot be used without wall chipping. Just between these poles, I had additional experience with inexpensive variations of the Chinese ESP8266 microcontrollers with Wi-Fi interfacein various factory relays and sensors. But since there was an opportunity in the apartment to do everything from scratch, then first of all I considered the wired version and these were the following interfaces and products:

  1. Knx
  2. Loxone
  3. Wiren board
  4. PLC ARIES
  5. MegaD 2561

For a very long time I looked closely at the decentralized KNX bus, which is not tied to a specific vendor. I even visited several installers in Perm and in Moscow, but the voiced amounts only for equipment (~ 700k rubles) were dumbfounded. As a result, KNX had to be abandoned.

Wiren Board and Loxone also fell away for financial reasons.

The ARIES PLC seemed to me too clumsy for the sounded tasks - nevertheless it is industrial automation.

So there is only one option left - the MegaD 2561 controller from Samara. In addition, I already had experience working with him.

An attempt to attract a developer to my undertaking


I made an attempt to change the electrical wiring of the apartment by the builder, for which I made a request: A negative response was sent quickly. The answer of the developer

1- № XXX, XXX XXX . , , 179, . , 48, 41,70 ..

, , , , . 48 .






Drawing up work projects


After the builder refused to cooperate in 2017, I compiled:

  1. furniture placement project;
  2. cabling projects for all cables;
  3. power board designs;
  4. wiring diagrams for switchgear actuators.


The project of the arrangement of furniture in the apartment is 41 square meters. m (drawn in Sweet Home 3D)

It all started with a project for arranging furniture and household appliances, and then a project for broaching all cables was developed (below are two of the 8 designed sheets).


Layout of power cables VVG 3x2.5; VVG 3x1.5; VVG 5x1.5 Layout of


a twisted pair cable UTP 5e

Then I began to delve deeper into the topic and draw the projects of power shields, below is an example of one of 5 developed sheets.


One of the three electric switchboards.

After that, the automation design started: what and where to connect, to which port - there were too many cables. Automation with MegaD-2561. Below are two of the eight sheets of the wiring project.


Wiring of the power unit on the MegaD-2561 actuator

Almost all power lines are stretched from the consumer right into the shield - this greatly increased the length of cable routes, but I wanted to make the maximum preparation for automation.


Wiring for connecting sensors on the MegaD-2561 device

Repair and finishing work


After drawing up all the projects and the final delivery of the house by the builder, work began on the dismantling of the existing “repair” and the electric networks of the builder.


Dismantling the repair in the bedroom

After the dismantling, construction work began, including cable pulling, coupled with the shtroblenie walls.


Broaching new cables

During the repair, I had to quite often make changes to the wiring designs, adjusting everything locally.


Photo with rough cabling

The most important thing for home automation is to bring all the cables into a single and convenient place. As this place, I chose a niche manufactured by the builders - a closet for things - located in the hallway, next to the front door.


Three electrical cabinets - a single place to mix all cables

Software configuration difficulties


After the repair was completed in early 2018, the most interesting thing began - setting up all systems and selecting control programs for a smart home.

And with all this there were some difficulties. Because if the builders made the entire repair in about 4 months, working at the construction site every day, then I spent only a few hours on this and then not every day. Therefore, it took me another three months to finalize the setup.

At the very beginning, the process was slowed down by the fact that I couldn’t configure anything remotely: the telecom operator connected the apartments via GPON (Gigabit Passive Optical Network) and there was an end point of connection in the form of a Huawei router, but I wanted to have MikroTik, because , in my opinion, it is one of the best in terms of price and quality for today. As a result, the dream came true, but it's still a couple of weeks to the time spent on the setup.


Setting up Huawei HG8245H in 2018 to work in tandem with MikroTik

I had a separate wiring closet inside the apartment under the ceiling for the equipment of communication providers - it was pre-arranged for repairs (you can see the diagram above), not only were extended to it during the repair stage twisted pair, but also an optical cable.

Home automation on openHAB and Home Assistant


Initially, I started doing all the home automation on openHAB. And that wasn't a quick start, although I already had experience with openHAB. What is this home automation system like?

openHAB (stands for open Home Automation Bus) dates back to 2010, when it was developed by Kai Kreuzer in Germany as an open platform for building automation. In 2010, practically no such solutions existed and openHAB largely became the prototype of the variety of smart home systems that we are observing now. His idea is simple: combine solutions from various manufacturers on one open software platform, regardless of protocol and technical features. This allows you to get away from a particular manufacturer and use all products with a single management interface.


Visual Studio Code. openHAB VS Code Extension

The most important executive device for home automation in the apartment was the MegaD-2561 wired controller - it is he who turns on and off the light, receives readings from all sensors and meters.

It has a fairly low price compared to peers ~ 3,500 rubles. (at the end of 2017) for the controller plus two additional modules are required for operation, for example:

  • The first module: on 7 standard inputs, 7 relay outputs 0-220V (7 * 2300W / 10A): ~ 3 000 rubles (at the end of 2017);
  • The second module: 14 universal hardware-configurable inputs + 1 relay output with the ability to connect both buttons and digital sensors I2C, 1-wire, etc.: ~ 3 000 rubles (at the end of 2017);

I have two sets installed in my apartment, that is, these are two controllers and four additional modules.

Looking at its relatively low price, you can decide that this is an ideal device for home automation, but this is not entirely true. This is primarily a Geek DIY device, and if you do not have enough time and patience for the initial setup and physical connection, then it is NOT for you. Also, the MegaD-2561 will not work out of the box, such as Xiaomi Mi Home.

And if the automation in your apartment or house is not done by you, but by a special organization, then you are unlikely to be offered this device because it is too low margin for a professional installer.

But I had the desire and time to figure everything out on my own and at the same time get the “adult” functionality (which this device can provide with proper setup), because according to KNX, which I initially looked at, I was counted only for the equipment at such a price, which I eventually paid for all repairs, furniture, and all electrical work, including equipment and sensors for automation. And according to KNX it was only the price of equipment without installation and configuration.

My apartment configuration in openHAB 2.2 on GitHub:
https://github.com/empenoso/openHAB_one-room-apartment/

At first, everything worked in the apartment, but a year later I ran into insurmountable difficulties with openHAB in the simplest things that I have done many times in the past. Therefore, in 2019, he decided to switch to the Home Assistant.
, . .

UPD. .


In the first part of the article, I talk about what I dreamed about in 2016 and what I got by mid-2018. I also talk about my failed attempt to attract the developer to the topic of home automation and that led me to independently compose all automation projects.

In the article I bring photographs from a construction site with repair and decoration works. I also complain about software configuration difficulties and talk about the openHAB home automation system.

In the second part I will give all the finishing photos of the apartment and all the resulting electrical panels, as well as talk about the difficulties that I encountered in another home automation system - Home Assistant.

Author: Mikhail Shardin .

Illustrations: Mikhail Shardin.
Illustrations related to Home Assistant: Alexey Krainev xMrVizzy.

February 5 - 25, 2020

All Articles