Cheap DIY Temperature & Humidity Sensor that works with ESPHome & Home Assistant

Тәжірибелік нұсқаулар және стиль

Wemos D1 Mini (AliExpress affiliate) - s.click.aliexpress.com/e/_AFgAIp
Nowadays, DIY wireless smart #Temperature & Humidity #sensor that can be added in #HomeAssistant can be very easy and cheap. Especially, if you have a complete guide like this one that will show you all the steps. I will try my best to show you everything: what parts are needed, how much they cost, from where to buy them, how to connect them, how to configure them, how to install ESPHome and finally how to add your smart DIY Temperature & Humidity sensor to Home Assistant. On top if you have access to a 3D printer I will also show some enclosures that can make the sensor looks better. So, buckle your belts as we are starting with the needed parts for this DIY Temperature & Humidity sensor.
► MY ARTICLE ABOUT THAT TOPIC - peyanski.com/diy-temperature-...
► AFFILIATE LINKS
D1 Mini - s.click.aliexpress.com/e/_AFgAIp
D1 Mini in Amazon - amzn.to/3A5jNoc
DHT22 T&H sensor & Jumper wires - s.click.aliexpress.com/e/_As7y5k
DHT22 T&H sensor in Amazon (3pcs) - amzn.to/3qzcORi
Jumper (Dupont) wires - s.click.aliexpress.com/e/_A3YiR3
Micro USB cable - s.click.aliexpress.com/e/_AnrsGw
USB adapter EU US UK - s.click.aliexpress.com/e/_Ataxcq
SwitchBot Flash Deals - switchbot.vip/3BwF221
Shelly Official Store - bit.ly/3BwMMn2
Aqara Amazon Store - amzn.to/3EpeCSb
Reolink Flash Deals - shrsl.com/301ih
Tech that I’m using right now - www.amazon.com/shop/kpeyanski
Get $100 in credit over 60 days for DigitalOcean - m.do.co/c/6dd2caef1f1f
► CRYPTO AFFILIATE LINKS
Sign up for Crypto.com and we both get $25 USD (Referral code: xn86atnceg) - crypto.com/app/xn86atnceg
Binance - One of the biggest Crypto currency exchange - www.binance.com/en/register?r...
► MY GUIDE
Smart Home Getting Started Smart Home Guide v2.0 - peyanski.com/product/smart-ho...
► SUPPORT MY WORK
Patreon - / kpeyanski
Paypal - www.paypal.me/kpeyanski
Bitcoin - 1GnUtPEXaeCUVWdJxCfDaKkvcwf247akva
Revolut - revolut.me/kiriltk3x
► TIME TABLE
00:00 Intro
00:15 What will you see in this video?
00:44 What parts are needed?
01:50 How does it all cost?
02:26 How to connect D1 mini and DHT22 sensor?
03:14 How to install ESPHome add-on?
05:31 Edit ESPHome configuration for the DHT22 sensor attached to D1 mini
06:19 How to install ESPHome on the D1 Mini?
08:37 Challenge for you!
09:02 How to add D1 mini and DHT22Temperature & Humidity sensor to Home Assistant?
10:37 Possible 3D Printed enclosures
► IF YOU DON’T HAVE HOME ASSISTANT CHECK THIS GUIDE
peyanski.com/how-to-install-h...
► ESPHOME CONFIG
sensor:
- platform: dht
pin: D2
temperature:
name: "Living Room Temperature"
humidity:
name: "Living Room Humidity"
update_interval: 20s
► LINKS TO THE 3D PRINTED MODELS:
- DHT-22 / DHT22 Wall box with ESP8266 - www.thingiverse.com/thing:261...
- "Öl Broker" Wemos D1 Mini mit Sr04 & AM2301 mqtt - www.thingiverse.com/thing:514...
✅ Don't Forget to like 👍 comment ✍ and subscribe to my channel!
► DISCLAIMER
Some of the links above are affiliate links, where I earn a small commission if you click on the link and purchase an item. You are not obligated to do so, but it does help fund these videos in hopes of bringing value to you!

Пікірлер: 102

  • @jordanyehle8203
    @jordanyehle8203 Жыл бұрын

    This is great! Just put three together super quick. Thanks for the walk through!

  • @randrewright9063
    @randrewright90632 жыл бұрын

    Thank you very much for this video and information. I used your guide and all 3 sensors worked perfectly.

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    You're welcome! Great to hear that and enjoy!

  • @JesseG2573
    @JesseG25732 жыл бұрын

    Great video KP. love the simplicity. I have them in every room of my house, also In the attic, outside under a covered porch, and in the garage too. They work great. I keep the sensor away from the board because the module gets a bit warm and I wanted open-air temp and humidity. Also, don't forget to back up and save each ESPhome device config just in case...

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Great tips & Great comment! Thanks :) Are you using exactly DHT22 sensors?

  • @cbristow23
    @cbristow23 Жыл бұрын

    Thanks for the video. I did have some initial difficulties and learned 2 important things: 1) if you are using a raspberry pi with Home automation already, and are using Zigbee, you may need to disconnect the zigbee dongle while first configuring the ESP. The SB ports on my Pi were very noisy. Once configured and running on wifi, no problem. 2) I needed to add a 4.7K pull up resistor (as suggested by some others if I was having difficulties. That helped the reliability of the DHT a lot.

  • @diederikmaes2367
    @diederikmaes23672 жыл бұрын

    Great tutorial for people still scared of ESPHome and boards. FYI, you couldn't do an OTA install because your board wasn't on your Wi-Fi yet. After the first flash you can do all updates OTA.

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Thanks for the comment and for the tip 👍

  • @EsotericArctos
    @EsotericArctos2 жыл бұрын

    I use to make my own sensors., adding light sensors, motion and the temp and humidty all in the one device. Some even had LED's I could use as night lights. I loved it in many ways, but these days a lot of ZigBee sensors, like the little Xiaomi ones, are just as cheap and also local (no cloud needed) so I stopped doing it. Not to mention the fact the ZigBee ones can be battery and last a while between changes. That said, really great to see a new video on how to do all these sort of sensors. Most of the videos on KZread are not very recent

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Yes, battery sensors that are working with HA locally are no brainers. Thanks for the comment Brendan!

  • @tamias82
    @tamias82 Жыл бұрын

    Thanks for this, I had a great fun setting it up. Mine was giving me very wrong readings. I had to add this line to the ESPHome config and reflash it to fix the issue: "model: AM2302"

  • @McArty2
    @McArty22 жыл бұрын

    DHT22 is good for temperature readings, the humidity though started to fail on me after a year, reading 99% almost all the time. Probably because i smoke in the room, gonna try some methods to revive it. Nice video as always, Peyanski, thank you very much!

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Thanks Arturo, glad you like the video! Mine Dht22s are working great for over 2years already, but I’m not smoking so this could be the reason in your case indeed.

  • @gnostyle
    @gnostyle2 жыл бұрын

    helpful and smart guide: can be awesome a video with more sensors on this board ; - )

  • @markusdick5534
    @markusdick5534 Жыл бұрын

    Hi KP, now i build up this sensr and all is working verry well and I enjoy your videos by homeassistant as nthing else. Thanks for your good and perfect help, Ys markus

  • @paulocesarsantos1266
    @paulocesarsantos126611 ай бұрын

    man thanks, seriously thanks, I love U!

  • @KPeyanski

    @KPeyanski

    11 ай бұрын

    Glad I could help! Did you manage to make some?

  • @richardnaish5100
    @richardnaish5100 Жыл бұрын

    😀#thowned Thanks, great work! I had to make to make a couple of small changes to the esphome config edits that you showed in the video to get accurate readings from the DHT22. I include the edited version below in case anybody else is having the same problem........ sensor: platform: dht model: DHT22 pin: D2 temperature: name: "My bedroom temperature" humidity: name: "My bedroom humidity" update_interval: 30s

  • @KPeyanski

    @KPeyanski

    Жыл бұрын

    Thanks, and enjoy your DIT TH Sensor

  • @matejduriak1215

    @matejduriak1215

    Жыл бұрын

    Thanks, you saved my day

  • @throttlenerd
    @throttlenerd10 ай бұрын

    Great, thanks!!!!!!!! Will try it )

  • @KPeyanski

    @KPeyanski

    10 ай бұрын

    Hope you like it!

  • @acmateriales6125
    @acmateriales61252 жыл бұрын

    You can't hide your acent speaking, I've noted right away you are from geniusland! Thanks bro

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Haha, nice one ☝️ many thanks 🙏

  • @Kisbalta
    @Kisbalta10 ай бұрын

    Hi thanks for the video, very usefull. Sometimes you need to add this line: "model: DHT22" too, otherwise you will get strange readings (at least for wemos D1 pro).

  • @nilleftw
    @nilleftw Жыл бұрын

    I couldn't get my temperature readings to go off. I realized you needed to "install" the changes, if you edit the yaml afterwards. Did an update or install, and got the temperature/humidity readings right away.

  • @davidwentireland
    @davidwentireland2 жыл бұрын

    Great video Kiril! Last week my wife asked if I could make a temperature sensor to put in my daughter's school bag to track how cold the classroom at school was getting. Sure I said... thinking about how best to power a pi or an esp. Gee it grew into a major exercise! If I go esp I need a sd memory module and a clock module on top of figuring out power... This might take me until the summer! I will keep you informed :)

  • @tovmax1

    @tovmax1

    2 жыл бұрын

    There's no need to use esp for this. You can take plain vanilla arduino Uno or Nano along with SD card module. Plus a battery cell box with 4 AAA to power it all.

  • @davidwentireland

    @davidwentireland

    2 жыл бұрын

    @@tovmax1 Thanks. Won't I also need a clock module? The unit won't be connected to the Internet and I need to log the time that the temp was logged?

  • @tovmax1

    @tovmax1

    2 жыл бұрын

    @@davidwentireland You are right, the RTC will not be superfluous for your task at all.

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    What a great challenge :) Say "Hi" to your Wife and your Kid. Wish you success and don't forget to share the end result with us 👍

  • @davidmack9303
    @davidmack93032 жыл бұрын

    Just got into Home Assistant, have been using your videos for guides! Thanks for the help! 2 questions. First, the dht11 appear to be slightly cheaper (I'm prefering amazon for now so I don't have to wait so long for shipping). Will these work/is there a draw back to these? Question 2. Instead of powering these with micro usb, can they be spliced into say an led strip that's running off 5volts? Thanks again for all the help!

  • @benoitmuller1726
    @benoitmuller1726 Жыл бұрын

    #thowned!!! Thanks for this very easy video, I manage to install my d1-mini temperature + humitidy sensor at the first time 🙂

  • @KPeyanski

    @KPeyanski

    Жыл бұрын

    Nice work! Congratulations and enjoy your T&H sensor :)

  • @ronm6585
    @ronm65852 жыл бұрын

    Thank you sir.

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    As usual Ron, you are welcome :)

  • @CubE135
    @CubE1352 жыл бұрын

    Just followed your Video Tutorial. This is my first time doing anything with microelectronics and it worked perfectly! :) Thank you very much! #THOwned

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Nice work and welcome to the club. I must warn you that this thing is addictive 😂

  • @CubE135

    @CubE135

    2 жыл бұрын

    @@KPeyanski Haha, thank you very much :) I do have one problem. Initially, when connected to my Raspberry Pi, right after installation, the sensor reads pretty accurate data. But as soon as i disconnect it from the Pi and reconnect it to the Pi or use a Power Adapter to plug it into my wall outlet, it reads temperatures at -10°, which is far from correct. So it seems like, disconnecting and reconnecting somehow "destroys" the readings permanently. I have tried different wall outlets and different Power Adapters. But they are all 5V adapters, which should be fine according to the ESP documentation. Any Idea what is wrong here? :P

  • @CubE135

    @CubE135

    2 жыл бұрын

    A reinstall of the ESP will fix it, but as soon as i pull out the USB from the Pi, and plug it in anywhere, its broken :(

  • @mattsimmons2448
    @mattsimmons24482 жыл бұрын

    Thanks

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Many, many thanks for the support. Please join my Discord server and ping me there! I have a little gift for you as well!

  • @jasonstation
    @jasonstation Жыл бұрын

    Could not connnect to board through ESP Home with any method. I always run into problems lol. Can use Arduino IDE software with no issues tho. Any way to integrate my device into Home Assistant after setting up with IDE?

  • @pcampane99
    @pcampane998 ай бұрын

    Might be a dumb question, but I'm learning so maybe others have it as well...I've set up a few ESPresense esp32 devices and those have been fun to play with and add automations for. I've gotten this now thanks to your video (thanks, as usual)...can 1 single esp32 board (or any of them) manage ESPresense and Temperature and Humidiity, or not possible? Just curious, thanks as always for the great videos!

  • @MaxGoddur
    @MaxGoddur Жыл бұрын

    Decided to build this and was surprised that in my yaml pin: 2 is entered yet the physical wire is on D4, why is this working thought the data pin was supposed to be D2? Also can't type in D2 under pin it doesn't like that so I have to enter just 2?

  • @arteunporro
    @arteunporro2 жыл бұрын

    ¡Gracias!

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Many, many thanks :) Feel free to join my Discord and ping me there so I can give you a small reward!

  • @BrianThomas
    @BrianThomas9 ай бұрын

    What if i wanted to connct more than one temp sensor for accuracy? How do i connect it?

  • @nebulousJames12345
    @nebulousJames123452 жыл бұрын

    I did this same setup. I tried out 6 different dht22’s and 3 different boards. The temperature was consistently lowat about 14 Celsius. And humidity stayed around 5-15%. When in reality temperature was 22 Celsius and humidity was 49%. What could be the problem?

  • @SayWhatnot
    @SayWhatnot Жыл бұрын

    Hi i don't have raspberry pi. can we use arduino uno instead?

  • @vaibhavkarar8858
    @vaibhavkarar88582 жыл бұрын

    I want to add pH and EC sensors in esp8266/home assistant

  • @ericilkwatson5557
    @ericilkwatson55575 ай бұрын

    When I place my device in a case, the temperature reading is higher than it actually is. Can I adjust this in any way?

  • @085-vaibhavgusain9
    @085-vaibhavgusain9 Жыл бұрын

    Can I use DHT 11 sensor?

  • @williamrosswhite
    @williamrosswhite Жыл бұрын

    This may be crazy, but what i really want is a body temperature sensor to turn on the air conditioning if I myself get too hot

  • @marcloehr
    @marcloehr Жыл бұрын

    #thowned thanks a lot fot this nice tutorial including every step! 😀👍

  • @KPeyanski

    @KPeyanski

    Жыл бұрын

    You're very welcome and congrats for the effort :) Enjoy!

  • @harold4113
    @harold41132 жыл бұрын

    #THOwned Great job KPeyanski. Worked the first try.

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Welcome to the club! Enjoy your cheap and pretty useful sensor! And don't forget to check my other DIY smart sensors videos

  • @johankarlsson7484
    @johankarlsson7484 Жыл бұрын

    When plugged into raspberrys usb, then installed, is it possible to disconnect the D1mini from the raspberry and put it up somewhere else just providing it with power and still get the reedings throuh wifi?

  • @KPeyanski

    @KPeyanski

    Жыл бұрын

    Yes, of course :) Enjoy!

  • @tartine3966
    @tartine3966 Жыл бұрын

    Nice tutorial, I made 3 sensors like this, they only work after pressing the reset button on the d1 mini once (if not they read completely off values like negative temperature and 20% h). And also they become unresponsive after some time or I think after a certain number of reading. Do someone know why ? (I don't use resistors)

  • @tartine3966

    @tartine3966

    Жыл бұрын

    So I found that adding "model: DHT22" after "platform: dht" makes the sensor read correct value right from the start without pressing reset. No more negative values. If the time out issue persists I will be able to toggle the usb power because I plugged them on a smart switch.

  • @j.jordens4700
    @j.jordens4700 Жыл бұрын

    In ESPHome 2023.3.1 it is not possible to choose "Pick specific board". Only ESP8266 and ESP 32 is available. IS there a work around?

  • @KPeyanski

    @KPeyanski

    Жыл бұрын

    Just Choose ESP8266 and you should be fine

  • @Petr.L
    @Petr.L2 жыл бұрын

    hi, great tutorial. Is this or a similar simple option for integration into a homebridge? Thanks

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    If you add homebridge integration in HA and expose sensors domain it should be visible on your iOS device.

  • @Petr.L

    @Petr.L

    2 жыл бұрын

    @@KPeyanski the thing is, I don't use a home assistant, only a homebridge ... I want to make a table control with 3-4 switches and a thermometer. This method with ESPHome in HA seems quite simple to me, but if there is a homebridge or homekit device, I am referred to the finished FW on github ... I found something, but not exactly what I want ... only to make each device special and that seems unnecessary to me. 2x ESP, 2x networked devices, and all in one box. One board does it too ... in creating FW for homebridge or homekit, I don't know that at all ... is there a similar guide as for ESPHome in HA? or another option how to make a simple DIY FW? thank you and apologize for the unnecessary questions 😇

  • @richardhobbs4995
    @richardhobbs49952 жыл бұрын

    My IoT network is hidden so when i install it says it cannot find my network, i guess i should unhide it then install then re hide it again? unless there is a simpilair way?

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    I guess you have to try. Good luck

  • @Mimbultonia
    @Mimbultonia2 жыл бұрын

    Followed instructions - while the mini is online - no entities show up - so no temperature / humidity readings.It's not a Wemos unit (instead an AZ-Delivery) but at a loss as to why the dht22 is not seen. Any ideas? Thanks

  • @Mimbultonia

    @Mimbultonia

    2 жыл бұрын

    it appears for my particular D1 mini I need to add "model: DHT22" to the D1 mini as the auto_detect default does not seem to find them!

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Thanks for sharing the answer. Enjoy the DIY Temperature Sensor!

  • @printclubflyer

    @printclubflyer

    Жыл бұрын

    If anyone else having this issue, restart home assistant after install. This solved it for me.

  • @damiandoan3907
    @damiandoan39072 жыл бұрын

    Is it possible to use this sensor without plugging it into the raspberry pi usb? I want it around the house so having it connect via wifi would be ideal

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Yes, of course! You need one USB adapter and you can plug it in any power socket.

  • @yurkshirelad
    @yurkshirelad2 жыл бұрын

    How long does the DHT22 last? I read they can dry out?

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    I have 2 DHT22 sensors working non-stop from more than 2-3 years I can't remember exactly when I install them. If they die after some time I will invest $3-4 more to just replace them

  • @kcusters7559
    @kcusters7559 Жыл бұрын

    #THOwned Nice guide! Except my readings are off. -12 degres, but it is about 20 degre... Is there a way to correct it?

  • @KPeyanski

    @KPeyanski

    Жыл бұрын

    Hmm, something is not right. Double check your wiring ...

  • @kcusters7559

    @kcusters7559

    Жыл бұрын

    @@KPeyanski Thanks for the reply. The wiring is OK. In the code I needed to add: model: DHT22_TYPE2 Seems like I have that sensor, after trying all the other. :) Now I got a dT of about 4 degrees. I blame this on the heat coming of the ESP itself? Because I use the D1 mini with the DHT shield close to it. Thanks!

  • @paulb7990
    @paulb79902 жыл бұрын

    #THOwned but the values that I am getting are wrong. Temperature and humidity are way to low. Any idea on how to fix this?

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Hmm not really, is it possible for you to try this with another TH sensor? Yours could be defective.

  • @paulb7990

    @paulb7990

    2 жыл бұрын

    @@KPeyanski Hi thx for your quick reply. I just tried 5 diffrent sensors on 2 diffrent controllers. The result is still the same... I guess I have to get other sensors. Any recommandations? Maybe those SHT31 that were suggested below in the comments? Anyway thanks for your work and all your great videos.

  • @ponciusz
    @ponciusz Жыл бұрын

    I am confused as there are people who connect 4.7k resistor and others who not? Whats the correct way?

  • @KPeyanski

    @KPeyanski

    Жыл бұрын

    For this sensor/approach you don't need resistor!

  • @muhammadumair9074
    @muhammadumair90742 жыл бұрын

    No pull up resister used. According to the document there needs to be a pull up resister between data pin and esp

  • @blakadders
    @blakadders2 жыл бұрын

    of all the sensors you chose the second worst one and the bulkiest one. Choose an I2C sensor such as SHT31, AHT25 or HTU21 instead

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    I'm using several DHT22 sensors for years and I have zero problems with them plus they are cheap. I know there are better T&H sensors out there but I don't need them for now.

  • @hippopotamus86
    @hippopotamus862 жыл бұрын

    Spend $16 and get one that does temperature, pressure and humidity and lasts 2 years. Aqara ones are very good and tiny.

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    why so much and I guess you had back luck?

  • @argamartaka3059
    @argamartaka3059 Жыл бұрын

    I've successfully made it but with DS18B20 for my koi pond, works great! The best thing is, I only spend $3. Thanks for this!

  • @KPeyanski

    @KPeyanski

    Жыл бұрын

    Nice work! Then you can freely use the #thowned tag ;) Enjoy!

  • @throttlenerd
    @throttlenerd10 ай бұрын

    #thowned !!!! )))))

  • @KPeyanski

    @KPeyanski

    10 ай бұрын

    Congrats 🎉 enjoy your DIY sensor and make some more after a while…

  • @grahamroberts776
    @grahamroberts7762 жыл бұрын

    #THOwned

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Good Job Graham, congratulations! Here is a challenge for you :) Watch my DIY Smoke Sensor video and try to make it as well. There is another hashtag there...

  • @marsomike
    @marsomike2 жыл бұрын

    #THOwned

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Oh Yes! Thanks for sharing and enjoy!

  • @stephenmorgan3750
    @stephenmorgan37502 жыл бұрын

    #THOwned

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    That is so great! Enjoy your cheap & useful sensor :)

  • @ladylodgers
    @ladylodgers2 жыл бұрын

    #THOwned

  • @KPeyanski

    @KPeyanski

    2 жыл бұрын

    Good job 👏 welcome to the club!

Келесі