 Hello, and welcome to my presentation. My name is Tomas. I'm working on Fedora, and I'm enthusiast into the IoT things and all the smart things that you could find. My presentation today is about my house, which I decided to turn into a smart home. So here's the house itself. It's over 100 years old, and I decided to turn it smart without having to do any destructive operations to the house itself. So I didn't pull any wires around. I didn't do any changes to the construction side itself. I just basically wanted to measure without the environmental variables inside the house, and then based on the measurements that I did, do the reconstruction of the property as a whole. First building block of all smart things is networking. Over time and our experience, I decided to use micro-tick devices, which are fairly useful and pretty configurable. At first, I used for my IoT devices the middle one, which is basically wireless router. It works fine. It works really nicely if you have like 20 entities connected to it, but once you start connecting more and more devices, it will basically, it cannot handle that much devices. So I invested in network infrastructure and covered the whole property with proper wireless signal. I decided to build all the entities myself. The idea here is to use some chips like ESP32 or some others, and build a baseboard with a pinout that I could use as a replaceable part for even the sensors, which are sensing the environment, presence of humans, animals, and everything else, as well as actors, which are basically buttons and switches which allows you to interact with the house itself. I decided to build everything myself. As some of you have been to the talk about IoT security, you maybe know that it's really comfortable to buy, let's say, smart plug for five euros from Chinese company, but actually you have to install smart phone application, and you have to give the smart phone application some really weird stuff like it wants to access your photos. Why does smart home controller needs to access my photos on my mobile phone? It needs to know your location. So I decided to build them myself, and not to use the convenient way of Chinese manufacturers. You can see I use multiple sensors. Here are some of the sensors that I'm using. As an enthusiast they just look over the Internet, both bunch of sensors, put them together, start measuring stuff, and after a while I realized that it's nice that the Chinese manufacturer writes on their sensor, like, this is the sensor that can measure temperature, humidity, and pressure. Well, it actually measures temperature and estimates humidity and pressure. Same thing goes for the environmental sensors for CO2. I was really happy to find out the sensor that can measure CO2 in your home for five euros. It's sort of like five euros. Devices cost around 100 euros in the real market. So I bought a bunch of them and I started measuring, and it was nice when you want to measure the baseline, which is like 400 parts per million of CO2, which is everywhere. It's nice. And I started seeing things like there are two people and a cat in a room, and CO2 level is always 400. What did I do wrong? Then I found out that actually it doesn't measure CO2. It just estimates it. It uses some physical law to actually estimate the number of molecules of CO2 in your air. And it also measures a bunch of other volatile compounds, but actually, as it turns out, it doesn't measure them. It just estimates. The funny thing about this chip is the one that you can see here. The funny thing about it is that it contains temperature sensor, so it can actually calibrate itself to estimate more precisely what the CO2 is. But the Chinese engineers somehow forget to connect to the temperature sensor to the sensor of the CO2 itself, so we have to do it by software. You have to read out the temperature and feed it inside the other sensor. From what I tested, the Dela sensors, which measures just temperature, are probably most reliable. I compared it with mercury-based, harder temperature meter, which actually, it was the closest one. Probably the most unreliable is the BME 280. It can measure multiple environmental factors. You can see it here, the temperature, pressure, and humidity. But again, it doesn't measure humidity, or it doesn't measure absolute humidity. It measures relative humidity, and you have to do some, you have to do some math there. So this is the first type of entities that I use, which are the sensors. They sense. Here are other sensors, which are present sensors. They use to detect if there is something which is alive in my house. The first approach that I did was passive infrared sensors, which is really nice. But basically what it is, is a thermal camera with one pixel resolution. So you can actually, it does not see a difference between moving cat or moving human. So what I ended up doing was my lights turning on in the house when my cats decided to walk around. And sometimes it didn't work at all, because the resolution was too low, and I had to put eight of them to cover six meter long hallway to actually be able to tell. So I decided to move to Doppler devices, which is this here, this small device here, and that is a pretty nice device. It allows you, what it does, it measures disturbances in an electromagnetic field, and it returns to you a pulse, which defines the mass and the speed of the thing that is moving inside the field. What it measures, actually it measures the amount of water that is moving through the space. So if you fill up a water bottle and just swing in in front of it, it will actually work, and it will say that something is moving there. Nice thing about this is that it can cover through walls, so you don't have to have thousands of those devices. I currently use five of them, and I'm able to say how many people are in my house, and even if they are sitting or standing and walking. And the other device is camera. I started using Crosbury Pies with cameras. It's a really nice solution. There is a motion IOS, which is distribution based on Alpine Linux, I think, which uses just the motion demon, and it's nice. You can set it up pretty easily, just burn it on the SD card, get it working, but, again, it's not that fast, and sometimes it happens that it detects movement, but it doesn't, it's not able to take a photo of the object that is moving. So I decided to use the combination of the Doppler devices and ESP cameras. Those ESP cameras are five megapixel cameras that contain ESP chips, so they're wireless. You don't need anything to do, to work with them, and you can easily switch them, turn them on, turn them off, make a photo of a thing, and even there is a bunch of pins that are not connected, so you can use the pins to connect some sensors or other interesting stuff. Then when I, now I'm sensing everything in my house, so I want to do some, I do some decisions, and I want to do some actions. So I decided to build a bunch of actors, which are basically two types of them, which is relays or buttons. My first, first try was, of course, I go to China, Chinese shop, both bunch of the devices, open them up, and I found out that most of them does not provide you with an easy way to flesh the device itself. All of them use the same chips that are used by enthusiasts that are used in the product, so it's the ESP-based chips, 32 or 8266, and they just matter on the, on the producer and on the price of the, of the thing that you buy. So I installed a bunch of them, I tested them, I decided no, I don't want to have Chinese spies in my home, so I dismantled them and I found out this device. That is pretty interesting. I tried to build something similar here, which is basically just the ESP with a bunch of relays, and soon I find out that that's not a, my solution is not a good solution, because the ESP restarts itself when it's restarted, it resets the outlet pins, so my relays just tick every time it restarts. It's not a problem if you are controlling lights, but it can be a problem if you're controlling doors, if you're controlling the heating system, or something which is critical, that it really, it really matters if the relay does what you expect from it. So I found out this device, which is basically the same thing you can see the four relays. What's nice about, about, about this manufacturer is that they provide you with nice pinout. You just need to do a bit of soldering, and then you can flash your own firmware inside the ESP chip. And I decided like, okay, Tomasz, you want to switch life wires, which is 230 volts in the Czech Republic, I probably don't want to build it myself because of the insurance mostly. So, so I decided to buy a bunch of the Chinese devices, flashed firmware on them, and they are pretty good. They're really convenient. You can see a bit of the, bit of the box there. You can mount them, mount them inside electrical, standard electrical boxes without any problems. The last thing on the hardware side was the power sources, power sources. So, first of all, I recycled a bunch of old phone chargers I had. Most of the boards have micro USBs, so it wasn't a problem. Then I read a bit. And I read about the phone chargers like they're not designed to be turned on constantly. Usually there's like two or three hours cycle that they are made to be on, and then you should be able to turn them off. So a bunch of them burned. A bunch of them got destroyed. And I started looking over the internet like, what would you use? So what I did, I bought a bunch of modules, which are actually inside the USB chargers that you have for your smartphones and stuff. I started working with them. Again, as it goes with products from China, it wasn't a good buy. A bunch of them exploded. A bunch of them didn't work. So I started looking around and I thought, okay, it's a power source. It'll be hot when something is cooled. So I bought a bunch of the devices again from China. Those are certified. They should work. Currently, I'm running them for more than a year. None has exploded. Everything is working. And they're pretty chilly. They're like 30 degrees Celsius. So I have my sensors. I have my actors. All powered up. I need to start controlling something. So I decided to use Home Assistant and ESP Home as a building block for the smart home. I'm not sure if you're familiar with ESP Home. ESP Home is basically a project that uses expressive a framework, which is the framework for ESP-based chips. It's YAML-based configuration. So it's pretty easy. It's easily readable. It provides you with all the air updates interface. So you just configure in the YAML file, hey, I want to have an OTA capability for this node. You set up the password or you set up the certificates. It's up to you. And you can use it. And the community, the open source community is really active. There was release, last release happened like a day ago or something like that. So it's all alive. The other was a Home Assistant. You can see the relay board that they used as I mentioned previously. This is how it looks in the Home Assistant. So it's basically four switches and four buttons. Each of them has a button. And the integration, again, is seamless. It's just the YAML file with the relay definition, the button definitions. And that's all. You can see some of the measurements that I did. This is one of the first prototypes of my node. And, okay, so some overview of the house. I'm currently running 25 sensors, which 15 of them are environmental, 10 of them are present sensors, and five actors. Okay, so what do you did, Tomas? So what I find out, I did over one million environmental measurements. That's fine, Tomas, so you measure the measurement, number of measurements. That's not really smart. And based on the measurements, I was able to calculate viewpoint in different parts of the house. The house is pretty old, so there is a problem with moisture. Now I'm able to approximate number of equipments in the house and each of the rooms. And I got the five gigabytes of photos. What I find out is that my kids are really fast, so there's mostly nothing on the photos. Time to time, there's a post-worker bringing some posts to my home. But mostly they're empty. And that would be probably everything. If you have any questions, please. No, I don't. No, I don't have a blog post yet, but I started putting stuff together. Actually, I'm not confident yet because I want to have at least one final product that I will use in my house that I will be sure that this is what I will be using all the time all around the house. And then I will start putting things online. But there's a lot of great resources you could find on the YouTube channels. There's a lot of maker channels that you can learn from. They will show you what sensors to buy, what not to buy. I discovered all those channels in the maker's community just after I bought everything. There's one thing, if you decide to build stuff like this on your own, be sure that you read the descriptions of the Chinese pages thoroughly. The biggest problem with the Chinese manufacturers is that they really vaguely describe what the thing does. It usually does what they say, but it's so vaguely described, like the environmental sensor that I mentioned, that you actually don't know. They say it measures. It estimates. This is a good question. There is one prototype that I did, as you can see here upstairs, which is a meteor station they used. This is actually second iteration, which I used amusing outside of my house to be able to measure the outside temperatures and the humidity. I'm not currently, and I probably will not ever use battery-powered devices, because lithium batteries are great invention, but they tend to explode. They tend to explode. I was using it for three months, and after three months it just literally exploded. It evaporated the whole case. The only thing that left after the first prototype was just the bits and pieces of the solar charger. That's why I'm not using battery power anymore. This is basically what you need on the other screen. This is the whole definition of the sensor in the ESP home. All you need is the ESP home tool and the YAML file configuration, and that's all. You'll just do ESP home name of the YAML file, and it will run compile and push it all to your device. The home assistant itself uses Mosquito, which is MQTTQ, and the Mosquito itself is used to collect the data from the sensors. Everything is Wi-Fi connected. I started to experiment with wired Arduino's, since you can buy pretty easily and cheaply extension boards that allows you to connect it to the internet, but that's just experiments. I'm not running it yet anywhere in my house. Just trying to find out if I can run it on cable. I started powering it using power or internet. No, I'm not using, the question was if I'm using any ZIGB devices. No, I'm not, and I'm not even planning to because of the prices of the ZIGB devices themselves. But I'm using Bluetooth dongles. As you can see, the ESP32 board, it does have Bluetooth on it. So what I'm doing is that I'm sensing presence of some of my smart buttons by the MAC addresses that are broadcasted by the ESP devices. So I have one button, which you can see here. And this button basically, what it does, it checks if there are any Bluetooth beacons around. It readouts if the Bluetooth beacon is in the room where I am, and then the button will act on the actor in that room. So I have one button for all lights in my house. Yeah, so I'm using automations itself from the home assistant. The home assistant allows you to define different kinds of automations, but I'm not, I don't have any automatic appliances yet. But for example, all my lights shut off after 2 AM if there's no movement in the house. You can define all these in the home assistant, which is pretty easily. That's a good question. Question was if I have cases for it. Currently, I have some cases, but mostly just reusing plastic cases, food storage cases and stuff like that. But I plan to, once I'm finished with the breakout board for the ESP chip, I will build a case that will be used all around the house for all the modules. They should be the same. Yeah, so I actually, first thing that I tried to control was my heating system. And I was able to do so. So I was controlling my heating system, and then I realized, wait, the control unit that I have for the original heating system, it states some kind of certification. So I asked my insurance agent, like, hey, what will happen if something start burning and actually I build it? It's not certified. Well, I was told that you cannot control any life appliances and expect it to be insured. If it's your doing, if you made the appliance and you're connecting it to something that you did, it's your fault. But if it's made by some company, you can always get the insurance done. Yep, including lights. Yep, so I'm out of time. Thank you for...