how to use gpio binary sensor by esphome for home assistant

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone last video I have showed you this es s board how to config the really output by the es home and in this video I will show you how to use this digital input for ESP set board so that you can connect with many dry contact sensor such as door sensor smoking sensor window sensor any dry contact sensor can connect with this terminal and so that your home assistant can monitor the sensor State and also you can do the automation uh such as One sensor triangle and relay output will be on and will be off okay let's step by step tell you how to config by ESP home let's look at this our A4 board that made by esp32 and this time first we connect with this USB cable the USB cable have connect with our server that have a RP USB port and this I have connected DC 12 Wat I connect with it so that the red will be on so the hardware is ready and this four channel is digital input and you can see this is this terminal is ground and this D1 digital input one D2 display D4 so L we will create this four terminal to home assistant by the ESP home okay let's put it here and you can see this our computer home assistant dashboard you can see I can turn on and turn off my relay and this is showed by the last video how to config it and this time we will look at this ESP home GP binary sensor so because the first you need to make sure what's your GP you have used in your ESP C board so you can see that also very easy just at last uh that will have a monit like this Windows sensor and how to config it just so easy sentence and the first we need to confir our Hardware which G we have used and this is esp2 module so you can see that is in digital input one digital input two and digital input three and digital input four so this four we will used and I have already list at here so that can see this GPL which number have used it easily just 36 and 39 and 27 and 14 so this will be used okay let's back to this es home uh GPL B sensor and first you need to see here active the internal pup resistance where you need to use this options you need to confirm with your PCB design so you can see at here here this ref for schematic and this is digital input one and you can see in our schematic at here that have some resistance at here the UT one have a resistance P up have connected with a three volt so this is our pull up resistance so we have design from the hardware to use this pull up so at here uh this command you not need to use it just delete if you PCP design without this pullup resistance you can enable the ESP to internal pup functions by this two command okay we can just skip this step for our Bo and the next the invert value so uh I can test it what this means we can just copy to our config file so I can and just copy and paste in our ESP home A4 part and At Last I just paste it here and this is binary sensor number one so I can see it here the number one digital input is 36 so I change to number is 36 GPL and the name you can also we can just as thing as this output I just copy it here just the name input uh this is A4 bar input one and the invert uh if we delete it delete it and press save and press install downloaded firware and by this USB cable okay wait for a moment that will be compl and begin downloaded to our USB set2 part okay now you can see that you have downloaded complete okay have connect successfully with the home assistant now I can click stop and back to dashboard right here and A4 part and we can add dashboard and add this binary sensor to our dashboard and add card and entities and this new table we can use this one input and A4 that you will see this import one you can see if for import one we have create and press C and we can click down and you will see this is the sensor state is here and now we can test our part and you will see pay attention to this state what is changed when I shut for the ground I have one cable connect connect to this ground and this another I will shut for the digital input one so I can remove this socket and just this is cor so this one side I have connect with the ground you can see this is the ground so I connect it and you will see if I shut with this digital UT one I use my cable and shut that will be the red L will be on pay attention to my home assistant when I sorry when I shut it that will be off and release it that will be on so this state maybe is not I wanted I want when I shut this cable at this point that will be on and the release this cable that will be off so the state is not I wanted I needed to change the state this I want to tell you what is the invert means so that can change the state uh the default setting is on or the first setting is off so this time I need to copy this invert uh to my home assistant configure y file I can copy and paste at here just to paste it here invert true if you delete it that means the is false so we need to set the invert to true and we can click save and click install again and download the frameware and let's test it what is changed and whether the inut state is changed the state okay complete and now let's test again so you can click overview and dashboard and this time you will see the input the default become off so this is our want let's test the cable and shut with ground and pay attention to my home assistant and this time I will shut this cable with my UT one you can see here a shot that is on home assistant is on release is off shut is on release is off so this inverted have added that is the logic we have we wanted so until now you have add this first channel of digital input one if you want add the rest digital input two three and four so just the copy and paste is very easy so you can see here at the home assistant y file and you just need to copy this Cod and copy and paste paste paste and change your name one two three four and also change the pin number uh the second you can see the second is 39 and the sir that is 27 and the next is 14 so I change to 14 okay easy just save and install my USB cable and the wa for moment okay complete and press stop and back to the dashboard and add dashboard and click edit and you can see we can edit here E4 this import to and A4 we can choose input three and A4 we can choose input four and press save and down and this time you can see here I have four chain of digital input Let's test it and you can see now I will shot with my digital input one that channel one is on and this digital input two that channel two is on and just input three that three is on and this next the four so this four is out so this I have added the four channel of digital input okay this is cre the four Channel and the last option is also sometimes is very useful that have a debounce value what that means maybe you have seen my video in uh before I have shot the ground that is not very good contact so this have a fi that will have a delete 10 what use for that means and pay attention to my uh video and this home assistance State and my cable you can see again if this cable or use or switch with not a good contact you can see just like like this just like this in my home assistant and will be the signal will be not stable so just like this maybe you have a button so this button have a not good contact so the signal will not very good so the signal will just just like this so this we don't want it so we can just add this fill it so this time we need to reduce this interference so we can use this these sections add this value and add this delay 10 so you can copy and paste I will show you just add this copy and paste it here for the number one channel one it's here we can about uh 10 million seconds uh just do this one add this this number behind this number so just add this we can change to uh 50 million seconds I just want to see you clearly and click save and click install and by the USB and after download I will compare the digital inputter one to sh the cable very quickly and the digital inut of two I show the cable Val quickly and you can compare these two State how it changed okay you can click stop and close it and we can see this dashboard pay attention to this input one and this input two now I can use this cable and Sh for input one fast you can see here and let's compare with the digital inputter two so you can see here that is fast faster change State and but the input one you can see this will be stable because it have the delete hand so that can reduce interference signal so this is first and this is this is slowly this is very fast so which time you will use this function uh for example it have a SW switch uh maybe you have you have very fast that have no good contact so that you can add this D 10 what value will add to this delay 10 I think for the W switch uh 10 or 20 milliamp is enough for you to use so at here we have learned how to add the Dig input and how to in Improvement the digal import experiments at here okay thanks for watching
Info
Channel: KinCony IoT
Views: 2,633
Rating: undefined out of 5
Keywords: esphome tutorial, esphome relay, esphome gpio switch, home automation, home assistant, smart home, esphome sensor
Id: Cq2zj4evUOc
Channel Id: undefined
Length: 15min 5sec (905 seconds)
Published: Mon Nov 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.