智能家居 #41 | 自制门窗传感器 | ESPHome 之门窗传感器(小白教程)~「Home Assistant」


Hi, everybody This is IT Commander What about this program What I’m bringing to you is a window sensor That’s the kind of open and close sensor You can put it on the door window Even in your drawer. In this case Somebody opens your window. Door The system will send the alarm when the drawer is in And what On your iPhone If you use homeKit You can get the same thing This alarm So let’s take a look at this little board in front of us It’s D1 Mini, up here I’ve got a lot of equipment, and I’m not gon na take it apart today And what I want to show you is that This part right here What about this part Yes A reed tube sensor, the open sensor, and he It’s very simple It has three pins Let’s take a closer look at these three pins Let’s look at the top VCC For those parts That’s the positive terminal We’re going to get him to the positive terminal of the Mini And then Let’s see In the middle it’s like a little antenna This is the negative terminal One plus one minus these two You can work at three and five volts But what about The recommended work is five 5v is more stable And then DO So that’s Data Out, our Data output What if this is a dry reed That’s what we use in our magnet If this closes he outputs a high or low level This is a very simple chip And then we have a knob on this side This knob is used to regulate its sensitivity So let me show you a little bit If we can supply the power of this chip It’s not gon na happen, it’s gon na look like this And you can see that this is a magnet And then We’re closer to him. And then we have a light up here And this one here is going to be a light Dry reed pipe closing When he’s out he can prove the reed pipe It’s a non-closed state So let’s try that again The dry reed is closed, open, so that I’m going to take this magnet to the door And then we can take this thing And it’s stuck to your needs A door or window that needs to be monitored or a drawer And then you can implement one using this ESPHome Implement a simple A door magnet sensor And then We can also look at the computer here, on the computer side Let’s look at the icon that has a door I’ll call it back door Of course you can call it something else And then we’ll open and close He’s gon na be in a very timely fashion Let’s go to the computer It’s perfectly normal to open and close Now the door is closed This one is open The door opens And actually this thing It’s a little chip of a few dollars And then the connection method I will I’m not gon na give you a detailed description of why I’m a Mini How many lines are you taking? Because of I’ve got a lot of equipment This is my light sensor This is my colored lantern This is a temperature and humidity sensor So what I’m not using the negative terminal of my 1-d mini The negative terminal is not enough So what I put a little piece of bread on the bottom What about this bread board I’m going to bring my positive and negative side to this side And then we use the positive and negative electrodes, and we reuse them, and we reuse my positive and negative electrodes for these chips I’m going to take the 5V jump over here, the negative terminal And then All the rest of the chips are going to be taken from this side of the breadboard So if you have a D1 Mini I don’t have a lot of equipment on it So you can think about adding a little bit What about a breadboard like me that has your D1 Mini You put the pins in the holes in the breadboard And then we use these jump dupont lines Put his positive and negative electrode And if you reuse that, you get a lot of sensors What about us? So let’s go back to our computer Let’s go back to our computer Let’s see how we can do that ESPHome refresh this window sensor Okay, so let’s go back to the computer And when I go back to my computer You can see my Home Assistant is a new one, this one It’s a mirror version of my new raspberry pi And the nice thing about this version is that it has a 64-bit operating system and All the Home Assistant related stuff These tools on the left are all installed in the form of Docker And And then there are some app stores Configurator, all of these things are in there If you like 64-bit systems And you have a raspberry pi You can think about changing my mirror image I’m gon na go ahead and put that image in the bottom of my video And my website And then I’m going to show you a little bit of this, this one There is a control interface for Docker I think you’re familiar with this interface And then you can see there’s some Node-Red, ESPHome And then there’s mopidy and these music players Motioneye, configurator, zigbee2mqtt So if you’ve seen my friend of the video that I’ve been with Zigbee2MQTT You use my firmware I’ve integrated this zigbee2mqtt You can plug your zigbee gateway into your raspberry pi and you can use it And then I added and I added IOBroker And then there’s the rest of Mysql which is basically the same And the main thing that’s going to be the one that’s going to increase one is OpenWrt A lot of people say Can not run in Docker OpenWRT And I tried it out That’s true And then the one on the N1 and the pi and the pi on the pi are all running What about my mirror image And I’m gon na integrate the image of the Docker in OpenWRT What about you If you’re interested, you can play. He opens it up and that’s what it looks like And if you want to use this image of Openwrt Make sure you use an ethernet cable You don’t want to use the wireless only if you have an ethernet cable This Openwrt is work, okay That’s not a lot of crap. Let’s go back to this Go back to Home Assistant Let’s see how we can add a window sensor like this Alright so I’ll give you Look at my blog and there is an article in the article That is Home Assistant uses ESPHome Making low cost door magnetic switch So what about this article It’s not finished yet I’m going to give him a little bit more The main one The main configuration That’s all We just have to put that in Copy it And then back to our Home Assistant Click on the ESPHome on the left And I’ll create a new node Let’s give this node a name Let’s say test And then we click next I now have a NodeMCU I’m stuck in my raspberry pi, I’m not using the D1 Mini that I just showed you Because of my D1 Mini It’s still gon na work And then we say Enter our WiFi name and password And then click next And then submit So we’re going to select a serial port at the top right corner of the big red circle We first write it You can see that there are two devices on this string and this serial port on the bottom is CC2531 The device of our zigbee2mqtt The top USB 2 serial port That’s our NodeMCU Let’s click on This USB 2.0 serial port And then we click on the red editor We’re at the bottom Add So let’s go down to the bottom and just add that in I have a problem with this computer So let me save that And then we click edit It’s normal to come in You can see It’s just that these sentences are as simple as that What if You switch is backwards If it’s reversed Let’s say your door magnet sucks And on our dry reed tube this door shows open And then The magnet goes out of the dry reed. This gate is shown to be off and we have to have a parameter ( False: True ) this option is to control the reverse operation of this operation In other words When you let him separate Normalised And then it’s going to be exactly reverse when it’s closed You can correct it and correct that in your chip Level value What about me I’ll go into the blog and detail this parameter Just to give you an introduction Welcome to my blog to get a sense of it And then we have this And then after the editing So we can click on this Upload So when we click on this Upload So our program starts compiling this firmware Compile and upload the brush My NodeMCU What about the process I’ve seen a lot of videos in the past I’m not going to give you the presentation here The process is also relatively long I don’t want to waste your time So I’m going to introduce you to this program Thank you all for coming and see you next time

5 thoughts on “智能家居 #41 | 自制门窗传感器 | ESPHome 之门窗传感器(小白教程)~「Home Assistant」

  1. 更多教程:https://1t.click/avAU
    电报 群:https://1t.click/avAX
    电报频道:https://1t.click/avBs
    Twitter : https://1t.click/avBg
    Facebook: https://1t.click/avBn

Leave a Reply

Your email address will not be published. Required fields are marked *