Andrei Canciu

Apartment Smart Home

Published 2 days ago5 min read
image

This was my firts smart home project. After finding smart home devices online I needed a "home lab" to learn and practice on some of them.

Planning

In 2017 when I bought the apartment from the constructor I had some requirements for the electrical, TV, and LAN installations . I asked for the electrical to be with Live, Neutral and PE cables from the main electrical box to each consumer (light or outlet). The request was made with my mind on a KNX sistem. I even bought green cable with 4 wires for the KNX sistem but unfortunelly the electrical team forgot to install it! I know! I was surprised too! Not having the KNX option I was forced to find an alternative. So on a saturday morning I decided to check all my electrical installation to see what I have and what smart devices I need to buy. On the electrical they used electrical connection dose instead of straight line between the electrical panel and the outlet or the lights. In my vison the controlling was made in the electrical panel for each line.

Adapting

Not as I wished it but it was too late to change anything, I was already moved in the apartment. As I was not able to controll the line from the electrical panel the solution was to controll the final consumer.

Consumers:
  • Lights including ceilling lights, bed lamps, LED strips
  • Outlets, A/C, TV, kitchen appliances, washing machine, IT equipments
  • Heating
  • Cooling
  • Garage door
  • Ai/ML Artificial Intelligence and Machine Learning

Lights including ceilling lights, bed lamps, LED strips

Lights controll was done by smart wifi enabled switches. The model I use was Sonoff Light Switch 1 gang and Sonoff Light Switch 2 gang.

On some of the light switches ware not suitable because of the modular design used by the constructor. The solution was using an switch hidden in the electrical dose.

image
image
Outlets, A/C, TV, kitchen appliances, washing machine, IT equipments

On the outlets was a different story. As we all know not all consumers are the same. For the bedroom outlets were I had one bad lamp with LED light bulb 13 watts and my phone charger the total consuption was no problem for the same 2 channels in dose switch.

The big consumers in my house were the air conditioning and the electrical oven. So for these one I had to use in dose 16A single channel switch. For these I choose the products from Shelly Cloud.

image
image
Heating

When I bought the apartment the constructor decided not to install any room thermostat. So I had to buy one fast because winter was close. I did not think about buying a smart one so when I started to make the apartment smart I was unable to contoll the heating. The solution was to build one from scrach using a single channel relay, ESP8266 chip, 2 buttons for manual setup and a plastic case.

Cooling

After moving in I realised I have to buy air condition unit. Of course I did not think about automation and did not choose a WiFi or expansion board option model. I had a simple 18.000 BTU non smart unit. So when I decided to cool my apartment before I got home from work I had only one option: IR Blaster. What is it? Simple, copy the IR code from the unit remote and send it to the unit from a smart device. There were many options on the market, plug and play type, but no! I can do it much more complicated! Take an ESP8266 chip put Tasmota as firmware and start coding. Result? Not working!!! My air conditioning unit was not using any standard IR ptotocols. Step 342: take another ESP3266 put the IR receiver and decoder Arduino Library and start capturing codes. 9 hours later I have the IR commands.

image
Image Credit: vsimonaitis
Garage Door

The garage was on the side of the building but insight from the balcony. Do you thing my wifi was reaching the garage area? Wrong! Of couse it din not reach it. First attempt was using a AP installed in the balcony. Worked fine until the outside temperatures droped really bad. Oh well... this was a lesson for me to read the working temperatures from the manual. The second solution was brilliant. LoRA (Long Range)! Is a low-power wide-area network (LPWAN) technology. On the balcony I had 220V for the LED strips and the solution was easy to install. On the garage door I installed 1 channel relay and the work was done.

Automation

This was the fun part for me! Air conditioning starting when I left work (but only if I come home) so in 30 minutes I find my apartment cool down and my TV on. The garage door opens when my front bumper is at 30 cm from the door. The lights starton a preseted mode and my PC starts with a short email about what happend in that day with my house.

At this part i was always changing something. Useing scenarios is fun but at the end of the day I had to write down what each device should do and say when to do it. At first it was fun but I got bored of this type of automation.

Ai/ML Artificial Intelligence and Machine Learning

The next step was to make the entire house make decisions by it self. Using my geo-location based on my iPhone GPS and the fact that I am or I am not connected to my cars free hand the house should know when or if I am coming home. Then start heating or cooling it self as needed. Lights and LED strips should set themself if I was watching Netflix, HBO or if we had any guest in witch case the LED strips should become reactive to the music but they only use about 50% intensity.

Project details Here...