A few months ago, I bought some cheap ESP32s on Amazon. I wanted to monitor humidity in a few spots around the house. I worked with AI to write some Arduino code that did a good job of reporting data to my Home Assistant via MQTT, but it wasn’t super reliable. WiFi would drop, and it sometimes had issues reconnecting. It was annoying to have to bring it to my computer to make changes, etc. So, I turned to the open-source community and found ESPHome.
ESPHome and its homepage look kind of intimidating, but their search function is great, and I was able to get something working pretty quickly. I’m sharing my setup here in case you want to get up and running quickly as well. All I did on this page was add the plugin to my Home Assistant install.
Next, I flashed my ESP32 device from my computer using this tool: https://web.esphome.io/.
From there (and because I already had my AHT10 wired up to the ESP32 via an I2C connection), I just needed to create a YAML file with the following configuration:
1 | esphome: |
Because I live in America (and despite knowing the metric system is better), I had to convert the temperature to Fahrenheit so I’d have a real sense of the temperature. I also rounded to the nearest whole number for clarity on my dashboard.
After that, I kept the ESP32 connected to my computer via USB, installed the software, and saw data coming in the log.
The last step was to install the ESP Home Add-On in Home Assistant, and it was off to the races.
Next up, I plan on adding some automations if the humidity or temperature gets too high or low. Here are a few use cases I have in mind:
- Alert if the humidity in my 3D printer area is above 40%
- Alert if the temperature in the 3D printer area drops below 50°F
Both of these would tell me something is really wrong in my basement, and I’d want a push notification right away!
Hopefully this helps you get started as well.