Full home automation in a new building. Continuation

Suddenly, an article about my experience in automating a one-room apartment of 41 square meters. m. in a new building , published two weeks ago, it became popular and on March 10 it was bookmarked by 781 imagepeople, viewed 123,921 times and Habr even filmed the ad unit in the "Recommended" section with the note "Interesting".


1500 meters of laid cables are not visible after the repair. The bedroom in the photo Here is a

continuation of the story, where I will answer comments, give photos of the apartment with furniture, the resulting electrical panels, and also talk about the difficulties that I encountered after I switched from openHAB to another home automation system - Home Assistant .

For those who hear this story for the first time, I’ll say that I had a dream to make the most complete automation in the apartment. This dream came to me as I began to get involved in “smart homes” in 2014. But until 2018, I could not begin its implementation for a banal reason - there was no apartment.

In the first part of the article, I write about the choice of technologies, provide wiring diagrams, photos, give a link to the source configuration of the apartment in openHAB (open source home automation software written in Java).

In the second part you are reading now, I want to start with the answers to the comments on the first part of the story, which were already 467, of which I realized that maybe I could not fully convey my basic idea that I wanted to make the most complete wiredpreparation for subsequent automation. This was necessary in order to use any controller in the future, without being tied to a specific manufacturer and combining different technologies. At the moment, this is possible using the Open-Source software hubs of home automation .

Comments replies


This is not my first year in the topic of home automation as a keen geek, so to speak, I have no commercial benefit from my hobby, but I like the process itself. Previously, while I still did not have this one-room apartment, it was difficult for me to introduce something at home. At home, like most probably, there were wallpapers on the walls, it was not known who made the electrician (and when), and if, for example, I want to hang an electric curtain for curtains? Their prices are very moderate (~ $ 100), if ordered outside of Russia, but what about wiring? It is impossible to control the curtains if there is no supply of electricity. How to be Throw the cable from the outlet to the window? Hang it with self-adhesive pads? If such an option would suit me, but other creatures live in the apartment with me - living beings - wife, children,Pets. If cables hang from everywhere, then what happens? How safe will it be for the residents? In general, it always stopped me.


Because of my desire to hang each consumer on a separate cable, even an ordinary shield without automation has grown to 54 modular. In the photo there is a power shield without automation with Chinese 1 din difavtomatami, immediately after assembly in 2018.

And in this apartment I got the opportunity to make full preparations for home automation. It is training. To think over all the options, I had experience. Decide what is best done so that later you do not have to experience mental suffering due to the fact that the entire "repair" is ready, but for this sensor I forgot to run the cable. You can ask what cable for the sensor in 2017 (all the same, all the design was in 2017, and not in 2020)? Of course, I know very well that there are ready-made and inexpensive wireless solutions, such as the same Xiaomi MiHome on batteries. Or Polish Fibaro (not so inexpensive). Or Chinese sensors that connect to factory products on the ESP8266 from Espressif Systems with a Wi-Fi interface. But these already need food. Everything related to batteries seems to me a half measure - you still need to keep an eye on them, unlike wired solutions or even ESP8266. Let them be on batteries,but they are actually installed in their places “forever” - hardly anyone will transfer them from place to place, changing for example the position on the door. In addition, the price issue - wired sensors are many times cheaper and more reliable in operation. Plus, the cable is also inexpensive, but only if it is possible to bring it “without snot” and without damaged repair.

Electromagnetic radiation


Many in the comments on my article referred to "The History of a Man Sensitive to Electromagnetic Radiation ." It seems to me that if you want to use the amenities of a smart home, then the wired solution is one of the safest for human health, if you follow the logic of the article.

And in modern new buildings, Wi-Fi channels in the 2.4 GHz band are so “dirty”, here is a real example from practice - the Internet works fine for relatives in the afternoon, but it is impossible to use it in the evening. Switching to 5 GHz solved their problem.


The place of information of all one and a half kilometers of cables according to the topology of the "star" type in the corridor of the apartment. Three electrical panels for 54 din modules are hidden behind the doors

With regard to my apartment - I have made a really large supply for all the needs that only crossed my mind. This means that out of one and a half kilometers of cables, at least 30% are not used and laid "in reserve". They are not connected anywhere and simply assembled with a “neat tail” in one place and distributed in different places by the other end of the cable.

Smart home and resource saving


I think a smart home is not about saving, but about comfort. In my apartment, the topic of ventilation was not shown at all in any way, because it practically didn’t bother me at all, except that the hood in the bathroom turned on in terms of humidity and there is an IKee hood in the kitchen. This my experience is completely insignificant in comparison with what Andrei @DarkTemplar did , in which “ black dust on the window accumulates in about three months ” and he put together a fresh air ventilation system, but as it turns out in the second part of the “tale” about apartment bills for electricity is quite considerable even with automation control.


The finish photo of the apartment is 41 square meters. m. after renovation in 2018: a kitchen with sockets and a 0.96 "OLED display (128x64) on the right side of the wall with an integrated SSD1306 controller and I2C support.

If you do not have a smart home and want to save money, then a complex smart home is completely not assistant in this regard. it is possible to spend on the design, equipment and installation of smart home so much that if you replace all of its LED lamps incandescent and kept them around the clock included all the same it would be more profitable than to install smart home.

smart in my opinion the house is:
imageConvenient - yes.
imageModern - yes.
imageTechnologically - yes.
imageSavings, in any case in the apartment - no.

How do you prepare for the future smart home - simple tips that I myself understood only in the process of work


I wanted to do everything as cheaply as possible, but this does not mean that I wanted to use incomprehensible solutions and solder on my knee. No.

I wanted to use only factory products so that there was no soldering and the connection to the finished contacts was used. I also counted on the fact that it would be possible to use any home automation system I want. As a result, I chose the most affordable option from the factory solutions - the device of the Samara manufacturer, but at any time, if necessary, I can switch to other equipment or generally safely remove the entire smart house (but not cables) from the apartment, including returning the usual control scheme lighting. Of course, the electric switchboard with automation will have to be redone, but the builders are not needed for this - an ordinary electrician will cope, who will reconnect the connections in the switchboard according to the scheme.

Some tips for preparing a wired smart home installation regardless of manufacturer:

  • Laying a separate electric cable from each lamp, switch, socket (groups of sockets) or any consumer of electricity to the apartment electrical panel;
  • Laying low-voltage cables to the places of installation of sensors and metering devices;
  • Electrical panel with a size of at least 48 modules;
  • Monostable (bell) switches;


The final photo after the repair was completed in 2018: a toilet with a bathtub, where a water heater is planned to be installed on the right wall and a 5x1.5 cable for controlling an electric crane is connected.

And tips for preparing for installing a wireless smart home, regardless of manufacturer:

  1. Distribution (soldering) boxes of large size (at least 150x100x70 mm) with the ability to access them;
  2. Lighting connection is not a classic circuit (using junction boxes where the cables are connected from the switch, lamps and the side of the shield), but modern - the power is supplied to the switch, and from the switch there is already a separate cable to the lamp;
  3. Deep undergrowths (not less than 65 mm);
  4. Do not put devices and controllers in metal boxes;
  5. Monostable (bell) switches;

I must say that it is better to choose between the 1st and 2nd points - using both points at once does not make sense, because if you put capacious junction boxes, then the modules can be installed there, and if you assemble the lighting connection with a modern circuit, then the distribution lighting boxes are not needed.

All these tips, of course, are just my personal opinion.

Electrical panels and controller


Since the word "shield" in a one-room apartment sounds ridiculous - all the panels are installed in the corridor behind the wooden doors, decorated in the general style of the apartment by a joiner.


Shield number 1. Power: there is a knife switch, protection device, contactor, 1 din dinavtomats. The insides of this shield were pictured above

Boxes with equipment - the most important part of the apartment for me. Here, the entire power part of the electrics and automation is concentrated. Everything is inscribed in 3 electrical panels for 54 modules, which are closed with wooden doors. When the wooden doors open, metal drawers become visible, each of which is signed.


Shield number 2. Here is the power part of the automation and the bell used as input

The first power cabinet - here comes the cable from the meter. The electricity meter has been replaced by a digital one, but left in a regular place near the door.

In the second panel, the power part of the multifunctional MegaD controller from Samara was wired. Several years ago, this controller had open firmware and, theoretically, everyone could use the physical components to assemble their own device with the same functionality. But in recent years, the firmware has not been revealed and you can only buy a factory-made product.

Product support is provided mainly on the device forum. I said that if you first hear about this device, then despite the low price, you have to spend a lot of time to deal with it?


Shield number 3. Cables from all sensors come here.

The third shield is the place where the cables from all sensors are brought to the executive controller from Samara.

Home assistant


I used openHAB for a whole year and was generally happy, despite some rough interactions with MegaD 2561 - its work with openHAB was implemented through a special Binding, which was written by an independent developer Peter Shatsillo and is a web server for incoming commands from MegaD to openHAB. The main function of MegaD Binding is to parse commands received from MegaD and generate commands from openHAB.


OpenHAB interface in April 2019

In Home Assistant, you can enter MegaD by standard means, without using separate integrations. With openHAB about a year later, in 2019, there was a delay in pressing physical buttons and probably I should have figured this out and fixed it, but by this point I had already developed an interest in Home Assistant. They started talking about Home Assistant and I was interested to try it.


The Home Assistant interface in March 2020,

Home Assistant and openHAB are actually ideologically similar in many respects, although they are written in different programming languages. Both of these software hubs:

  • independent of manufacturers;
  • allow you to combine various home automation technologies into one;
  • have an advanced rules engine;
  • comes with web interfaces, and also have their own applications for iOS and Android;
  • completely open source
  • supported by the community.

Alexey Krainev helped me a lot with setting up Home Assistant in the apartment. xMrVizzywho transferred the automation in this apartment from openHAB to the Home Assistant and added some of his devices, such as the Philips AirPurifier, the Roborock S5 robotic vacuum cleaner and even the optional Vera Plus controller, which he was also able to integrate into the overall Home Assistant control system.

The process was not fast and it all started with the familiar Home Assistant interface: the


usual Home Assistant interface in the summer of 2019

And one of the options for receiving information and sending commands to the Samara controller MegaD-2561:


Home Assistant settings editor via the web interface in the summer of 2019

As a result of the interaction Home Assistant with MegaD-2561 in Hass.io was found in different versions:

  1. By MQTT.
  2. HTTP GET- MegaD:
    — , :
    http://192.168.48.20/sec/?pt=35&scl=34&i2c_dev=htu21d;
    — , :
    http://192.168.48.20/sec/?cmd=all.

As a result, setting up the Home Assistant and MegaD bundle took about three months, though taking into account the fact that Alexey had no previous experience with either the Home Assistant or MegaD.

When everything was set up, Alex decided to go further in terms of design and as a result led everything to a dynamically updated Home Assistant interface without rebooting, based on the work of an enthusiastic person from the Netherlands:


Unusual but beautiful Home Assistant in 2020

If you want to repeat this experience and to change the Home Assistant’s own interface in a similar way, you can focus on the work of Jimmy Shings (Netherlands):
https://github.com/jimz011/homeassistant/ .

If you think that the topic with the apartment has not yet been disclosed, then let me know about it in the comments - what would be interesting to hear about

Total


I believe that the experience with the full automation of a one-room apartment was a success. For two years now the apartment has been functioning and pleasing to those living in it. No serious flaws were identified.

The configuration of the apartment is posted on GitHub:

  1. openHAB ;
  2. Home Assistant .

Author: Mikhail Shardin
Illustrations: Mikhail Shardin.
Illustrations related to Home Assistant: Alexey KrainevxMrVizzy.

February 5 - March 10, 2020

All Articles