Home Assistant ESPHome Setup (using DHT22 Sensor)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome in this video I'm going to be going over the process for setting up the ESP home add-on in home assistant so I'm not an expert at any of this I'm just sharing my experience if you want to see my previous home assistant videos I'll put a link below to my home assistant playlist and you can check those out there so to give you a little overview of what ESP home is it's an add-on for home assistant that allows you to connect esp32 and other boards to home assistant without doing extensive coding and such so I have a couple of examples of esp32 boards here and if you find this video helpful and you want to purchase some of these I'll put a link to them in the description and if you use that link it helps me out a little bit and doesn't cost you extra so the two boards I have here I think this was branded highight go but this is an esp32 S2 mini there are a number of companies that sell this identical board and then I had a viewer previously recommended the Seed Studio esp32 so this is an esp32 S2 and this is an esp32 C3 now you can do some searching online to see the exact differences if you're doing basic sensors they'll work mostly the same now this one has integrated Wi-Fi this one has an external ant an this one has more gpio ports this one has less so these are microcontrollers so these are essentially a little computer so this is a little computer shrunk down on a little chip and then it has gpio that stands for general purpose input output so what you can do with that is take things like this sensor this is a dht22 sensor and you can connect it up to the esp32 and you can collect data with this and send this to home assistant for tracking this one here has a CO2 sensor connected to it this one also does a temperature and humidity now these are two common style systems so to get this working we first need to flash the firmware to these so with these two esp32 boards there are different procedures for doing that so this S2 mini has some buttons on it one says zero the other says reset so you want to plug a USB cable into this and then plug this into a computer we're going to be plugging it into the home assistant server and it needs to be put into a certain mode for downloading firmware to it so to do that once you have it plugged in you want to hold down the zero you want to press reset let go of res reset and then let go of zero that gives a lot of people a lot of trouble with these boards they just plug it in and expect it to work but you have to do that where you press zero reset zero and that will get it into the firmware download mode now the Seed Studio board you just plug in and it works so this is an easier option now I tend to find that these are cheaper than this one so you'd say why wouldn't you just go with this for everything and then also this has more gpio so that could be a factor but I like to have a variety of boards so I can just test things if I'm having trouble with a board like this then I can try a board like this maybe it'll work gives you more versatility so I'm going to set this aside and this is the board I'm going to be using for my setup today so let's head over to the computer and get that configured okay so I'm logged into home assistant here I have another tab open that's for ESP home so this is ESP home.io and this has all sorts of information on setting this type of thing up so if we go over to the side here for quick search let's search for dht22 so we have a result here down for the DHT temperature plus humidity sensor we'll click on that so this can give you some information on set setting up the sensor so there are all sorts of sensors you can connect up to an ESP and then connect through ESP home to home assistant and actually on that first page it lists a lot of those here so on that first page it listed a lot on the left side if you know what you want you can search for the name of the sensor otherwise you can search through for the type of sensor you want so here it's going to show some yaml we're going to need this in a little bit now this isn't going to be perfect for what I need so it can help a lot of times to search the sensor you're using on Google or another search engine and find a tutorial on that specific sensor to get the yaml and the pins and everything worked out but this tells the different options you can use with this sensor so let's go back into home assistant the first thing you want to do here is install the ESP home add-on so I'm going to go to settings on the left side and I'll go to add-ons and then I'll go to add-on store and I'll search for ESP and here we have ESP home I'll click on that and then we have to click on install so this will install it and this may take a few minutes okay so we're installed we have some options here it says start on boot I want that on we have Watchdog I'll turn that on we have auto update you may or may not want to use auto update you do have to be careful that updates breaking things I'm going to leave it off but you may choose to turn it on and then we have show inside bar so that will show over here it says ESP home on the left and then we will start it so when you're setting it up you could have ESP home on the left for easy access but once you have all your devices set up you could turn it off on the sidebar so it's not cluttering up your interface and then if you ever need to get back into it you just go to your settings and then add-ons and then you can go to the interface directly from there so if you look at the bottom of the screen it says open web UI you can also click on the left those go to the same place so I'll do that now open web UI or I can go on the left click ESP home same place so we're at ESP home we want to add a new device so I have the esp32 S2 mini so I'll hit add new device at the bottom it says theice device needs to be connected to a computer using the USB cable and there are numerous ways to do this I'm only showing one method so we'll hit continue here we want to create a configuration so I'm going to call this studio temp I'll hit next went to tell it what kind of board we have we have an S2 we'll hit install it says how do you want to install on your device I want to plug into the computer running ESP home dashboard so I'll click on that it says no serial devices found so I'm going to plug a USB cable into my esp32 board it's a USBC cable it supports data now some ESP boards are going to use micro USB either way you want to make sure when you're doing the initial firmware download that you're using a cable that supports data there are some cables that are charge only cables and those will not work they will work after you get the firmware downloaded and you're just using the esp32 board for your sensor so I'm going to head over to my home assistant server and I'm going to plug the sensor into USB okay so I have my esp32 here is my server I'm going to plug into the USB here now on the screen we can see it's not recognizing this and that's because with this board I need to hold down the zero let's see if I can press that against the surface here and then I'll press reset I'll let go of reset and then I'll unpress zero and now you can see the board was recognized by ESP home so I'll click on that and now it's going to write the firmware to the esp32 now as far as it's concerned there's nothing connected to this it doesn't really care or know about it it's just installing the firmware later on we'll configure it for the sensor so you could in theory connect a bunch of these up without connecting the sensors up and just get them ready and then later go back and add sensors and configure them okay so it finished compiling the firmware and now it is uploading it to the ESP 32 so now we need to reset this to make it work I'm just going to unplug plug it from the home assistant server and I'll plug it in somewhere else in my house where it has access to Wi-Fi so I'm going to close this for now and you'll see it says offline and this will switch to online here in a minute and there it's online so I'll go to edit you don't have to wait for it to go to online to edit this but I'll hit edit and now I need to add some yaml down here so I'll paste some yaml in so I'm guessing most people will know what yaml is but some people may not but it's just code or really a configuration is probably more accurate so here we have sensor colon and then we have- platform colon DHT and then the pin is gpo2 so let's head over to the sensor and take a look at that real quick so here's the dht22 temperature sensor and this has plus minus and out so different sensors will have different pinouts and you'll need to research online how they connect up so I have these female to female Dupont connector cables and those are going to this esp32 and the plus and minus are going to 3.3 volts if I can get that focused in here so that's this one here and then the white is going to ground and then black is going to pin 12 now for these DHT 22s they need what's called a pull-up resistor and that is built into this module so that's why I say you want to go online and search for things before you build because you can get lots of tips so in my configuration I have that gpi2 then I have temperature colon name this is living room temperature I want to change this to Studio temperature unit of measure is degrees Celsius so if you don't know how to type that degree symbol you can just go on Google and search how to do it or you can actually just copy it somewhere and paste it in here then we have humidity we'll change this here and then we have update interval 60 seconds let's change this to 15 just for the video in actual usage I would probably leave it at 60 or maybe 30 so I'll hit save here and if we look at this and we look at the page on ESP home we have the yaml here it's pretty similar I used a different pin and I have that temperature and I have the units down here is anything else yeah so it's the pin and unit of measure I added in here so we'll hit install and before we said plug into the computer with the ESP home dashboard now we'll say do it wirelessly so this will connect over Wi-Fi and it will update the firmware on the ESP 32 now this should happen faster than the initial firmware install Okay so it has successfully updated the firmware now it's rebooting and if we wait a minute here it will give a reading for the temperature and humidity so we set this up to do it every 15 seconds so in 15 seconds from now it should show an update and there we have an update let me cut my hand around it now I've not found these sensors to be very fast with changes in temperature and humidity we'll see if this changes and I probably touched something here I touched the pins that probably didn't help so let's exit out of here I can hit stop or Escape let's go down to settings devices and services so here we have discovered devices this is a different sensor I have set up the CO2 is but here's the studio temp I'll hit configure it says do you want to add the ESP node Studio temp to home assistant I'll say submit we'll say the area is Studio I'll hit finish so now let's go up to the main dashboard and this automatically populates with any sensors I add and here it is right here Studio temp humidity Studio temp temperature so if I click on that after time this will show the history of the temperature and the same thing with the humidity but I just plugged it in so that's setting up the ESP home add-on in home assistant so there are countless sensors that you can connect up to Home assistant using ESP home not only that you could add switches and lights and things it's super versatile now one thing I haven't mentioned is that I'm connected up to these pins here and you can buy ESP boards with or without pins I tend to buy them without and solder on my own now really here I just have three wires so I could actually just solder these three wires directly to the board so it can be helpful to have some of these boards with pins in it just for testing and then when you figure out your configuration you can get a dedicated board and sensor and just solder it together or use pins now there don't tend to be a lot of enclosures for these I don't know if any you can even buy you might be able to 3D print some so you'll probably have to create your own enclosures now you could add other sensors on the board at the same time that wouldn't be a problem and when buying these things you can buy a lot of these on Amazon you can buy the esp32 boards you can buy the sensors and if you're in a hurry that's the way to get them but if you want to get them cheaper you can order them on AliExpress typically it might be 2 3 4 weeks to get them so if you're not in a hurry that's a way to save a lot of money and often times you're going to be buying multiple sensors in the same package like when I bought this I got two at the same time the esp32 board I got three at the same time but I'll put a link below to some of these boards and such so you can check those out but the nice thing about it is this equipment tends to be very cost effective and very cheap way to do monitoring and other projects so that's all I'm going to cover in this video if you have any questions please leave them in the comments if you like this video please click like if you haven't subscribed to my channel I'd appreciate if you could do that and thanks for watching until next time goodbye
Info
Channel: RickMakes
Views: 5,915
Rating: undefined out of 5
Keywords: Home Assistant ESPHome Setup (using DHT22 Sensor), esphome, esp32, home assistant, esphome setup, esphome add on, home assistant esphome, home assistant setup, home assistant automation, home assistant esphome integration, home assistant humidity sensor, esp32 projects, home automation, smart home, temperature sensor, esphome home assistant, esphome tutorial, esphome esp32, getting started with esphome, esphome temperature sensor
Id: qQJpi2P7LGE
Channel Id: undefined
Length: 12min 14sec (734 seconds)
Published: Mon Oct 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.