I've got 20+ devices running ESPHome, about 3/4 of them are part of my Home Assistant network, and maybe 6 or so that are standalone and just using ESPHome to talk to MQTT for other stuff (cheap Chinese weather station that I replaced the insides of with an ESP32, etc). I've got my rain water tanks monitored, my soil moisture in my greenhouse, the temperature and humidity in all different parts of the house, air quality in the kitchen and kids rooms, etc etc.
It's such an underrated project. In literally 5 minutes and with $10 of hardware and no programming at all, you can build your own IoT devices in your home and get real-time data on anything you want on your property.
Could you recommend a good component for security purposes? Like if someone enters my flat without breaking in (I rent). The docs list a bunch of options... do I go for motion & presence or binary presence detector? Which sensor is better (and most cost effective)?
Depends on your threat profile and budget. Specifically if you're worried about your door opening, you can use a magnet and Hall effect sensor(or reed switch). Another thing you could do is PIR, but the cool kids are playing with 60GHz pulsed radar, which does presence pretty well (I've recently tested that the XM125 radar I just got can pick up my breathing and detects presence from the other side of 2x pieces of 3/4in sheetrock).
I'm definitely not a cool kid:) I was considering putting a camera in the flat and hooking it up to a visual motion detector but that would be a bit expensive probably (would probably need another server in addition to home assistant...)
Yeah that's overkill. But PIR and esp32s would work for the most part. (don't rule out the radar, it's only $50 bucks at Sparkfun lol I just got it working the other day, it's pretty awesome)
Ikea's PARASOLL? I would expect that for your use-case, just knowing if a/the door was opened is already enough.
Is Ikea stuff compatible with ESPhome?
Never mind, parasoll costs like $12. I mean something like HLK-LD2420 which should be around $2. ESPHome lists many similar sensors and I was asking which one is better. Curious if anyone had any experience with any of those
No, it's not compatible. I am sorry, I misunderstood the purpose of your question.
For home security I use PIR motion sensors in the main rooms feeding into Home Assistant which has a presence service, Eg it knows if we’re home or not based on whether our phones are connected to the home wifi. If we’re not home + it detects motion, it pings me.
Nice. Home Assistant looks easy to integrate with ESPHome... Though I don't yet have either.
I agree with everything here, except the $10 of hardware.
You must be running some very fancy chips!
For extra savings the ESP8266 might be as low as $4us. It really is amazing.
Or you could buy a rpi2040 for 99 cents.
That'd get you the chip which you'd have to solder to a board. Possible and feasible but not as easy as plugging in an ESP8266.
You would not only have to solder it to a board, you would also have to provide a radio peripheral. At which point you're pretty much looking at a pico W, which just isn't as cheap or small as a D1 Mini (or similar).
Wasn't there previously some problem with using Pico boards and you had to use a fork because PlatformIO were trying to get vendors to pay (for something they never asked for), and then kicking up a big fuss when they didn't pay up. I say vendorS because they are now trying it on with Espressif also. It seems like a very strange funding model. Did that get fixed? It was a depressing state of affairs when I last looked.
You can get a three pack of esp32 dev boards (with headers) for $6 from Aliexpress. For that you get:
1) Wifi.
2) Much more robust ecosystem, including esphome (the subject of this post).
ESP8266 is not recommended for new projects though. Its age is starting to show.
Is that an Espressif or an ESPHome recommendation?
Were I designing a product that uses one of these I would certainly not use the ESP8266. For hobby projects, if I can buy them on Amazon, eBay or elsewhere, the 8266 remains a valid choice (for me.)
I started valuing the enclosure that comes with the 10 dollar versions (e.g. the M5stack atom).
Since most use-cases for me are literally 1 sensor connected to an Atom, it (largely) fixes the enclosure problem. Although I'd like to have more DIN rail mounted options.
Now you MUST share more details on the hardware (case, power etc) and process you followed for all of those devices.
I am a VERY low-effort hardware person (even soldering is um, not my favorite) but for years my approach has been:
1) Go to Amazon and buy a three pack of ESP32 dev boards with headers[0]. They're always some random seller, etc but I've probably had one DoA/failure after buying dozens from random sellers over the years.
2) Get a dupont wires variety pack[1].
3) Optionally (but good to have) get some breadboards [2].
4) Familiarize yourself with various supported temperature/motion/humidity/relays/etc. Esphome has a supported list[3].
5) Search for the chip name, etc on Amazon. Example[4].
6) Familiarize yourself with the ESP32 dev board pins, GPIO, etc. Most sellers will include a picture that looks something like this[5] and most of them are pretty "standard" these days.
7) Wire stuff up, configure with esphome.
8) Once you have things up and running, shove everything in an old box (iPhone boxes are especially sturdy). Other options are various project boxes[6], 3D printing, etc. It's usually easy enough to cut out/drill whatever you need.
At the end of the day you can do some pretty impressive things like directly combining temperature sensors, humidity, presence detection, PIR motion, air particulate, relays, etc even on a single board thanks to ample GPIO and esphome. All for (typically) something like $10 per "location" where you need the stuff. Even less if you buy from Aliexpress, etc.
Of course for "install" you'll need power supplies and (typically) USB-A to micro-USB power cables but most of us have drawers full of these things from old phones, etc. Good news is ESP32 boards absolutely sip power (something like 100mW or less) even with all of your "stuff" attached.
[0] - https://www.amazon.com/ESP-WROOM-32-Development-Microcontrol...
[1] - https://www.amazon.com/EDGELEC-Breadboard-Optional-Assorted-...
[2] - https://www.amazon.com/Breadboards-Solderless-Breadboard-Dis...
[3] - https://esphome.io/index.html
[4] - https://www.amazon.com/Teyleten-Robot-Digital-Temperature-Hu...
[5] - https://lastminuteengineers.com/esp32-pinout-reference/
[6] - https://www.amazon.com/LeMotech-Plastic-Electrical-Junction-...
I had a solar powered project setup with environment sensors in my shed. After a while the bugs moved into the elctronics, corrosion ensued and caused shorts which killed everything. The lesson I learned is to seal project boxes up really well. The whole boxing something up and getting power to it thing is the hardest and least enjoyable bit of hardware projects for me.
Good point and batteries, solar, exterior environments, etc are what I would consider "advanced" use cases with significant additional challenges and considerations. All of my use-cases are interior environments with the most "challenging" being garages.
Generally speaking with any kind of lower-level electronics like this frying and bricking stuff is part of the learning experience and a rite of passage.
I read this as I'm standing next to my bare esp32 with dht22 temp sensor hanging off it with DuPont wires...
Nevermind the ones in the schoolhouse, basement, chicken coop...
So, yeah, I fully agree. One day I'll buy a 3d printer but until that day, wires and some tape. Everything seems cheap enough to be sacrificial if that's the end result.
As a fellow lazy hobbyist, I'm gonna suggest that buying the cheapest ESP32 / -C3 / -C6 boards can be a poor value. The cheap ones are often > 25.4mm wide so on a single standard breadboard the pins are only accessible on one side[0]. Also having recently been fighting CircuitPython running out of memory parsing a ~35KB response from a web service, boards with some PSRAM are real nice to have. And speaking of CircuitPython, ESP32-S3/S2 boards can run the UF2 bootloader for that Pi Pico-like experience.
Waveshare's super compact ESP32-S3-Mini (or Zero) has become my first-to-grab. For 5 direct from their China site it works out to $7.35/ea pre-soldered with shipping or save a buck each for unsoldered. 2MB PSRAM and 13 usable GPIO. They also have less cheap -S3 boards in Arduino Nano ESP32, Pi Pico, and ESP32-S3-DevKitC-1[1] formats. And the oddball ESP32 One in Pi Zero format, using an ESP32 w/ off-die PSRAM. They sell on Amazon, too.
A genuine Espressif ESP32-S2-DevKitC-1-N8R2 is $8 on Amazon, a relative bargain if you need it tomorrow and can live with one less LX7 core and no Bluetooth.
[0] If you use the trick of spanning two breadboards side-by-side, that's an extra cost that could have gone towards a better smaller board.
[1] Beware of cheap boards claiming to be copies of Espressif's 25.4mm board designs, many have been widened to ~28mm. Bad ESP32-S[3|2]-DevKit[C|M]-1 copies give themselves away by having enough room on top to put pin labels next to the pins instead of between them.
I keep a stockpile of cheap ESP32 and ESP8266s at home, and any time I need something "ensmartened" (opposite of enshittified?) I grab whichever one is appropriate, solder up what I need, design/3D print a case, flash it from my _other_ laptop which has Chrome on because Firefox doesn't support WebUSB :'(, and it'll show up in Home Assistant for adoption the moment it lands on my IoT WiFi network.
I did exactly this with WLED over the weekend, just to see what the ecosystem was like and what the capabilities are. That flow from soldered hardware to HA integration is astonishingly slick.
How do you monitor your rain tanks? I tried ultra sonic sensors but they invariably oxidize.
Vegetronix water level sensors sensors: https://www.vegetronix.com/Products/AquaPlumb/
They also have good soil moisture sensors that IIRC work via time domain reflectometry which is more accurate and lasts longer in the field.
There are magnetic sensors in which a floating magnet (sealed in plastic) position is read by sensors (Reed, Hall, etc) sealed as well.
Ultrasonic sensors are so cheap I just replace them once a year or so, but I’ve not for a few new prototypes going with ToF sensors and one using a pressure sensor, to look for a less wasteful solution.
There are new 60ghz sensors available that can do this (they can see through walls so you could have the sensor completely enclosed (maybe even potted in epoxy?!)). Sparkfun/Acconeer A121/XM125 is what I'm using,although not in this context, it's for my robot.
I've heard that pressure sensors are the most reliable.
There are black "waterproof" (weatherproof?) ultrasonic sensors that last a way longer time
How do you power them? I've used ESPHome previously to scrape my solar analytics for consumption in Home Assistant using $3 Wittycloud ESP8266's. But as yet I haven't found an elegant solution for powering them other than using a USB adapter. It would be nice to find an elegant battery solution for outside sensors.
You can buy off-the-shelf modules that take a lithium ion cell and provide charging, overcurrent and overdischarge protection; just search your Chinese online retailer of choice for "TP4056 module" and you will find plenty of them. There is a Hackaday article [1] that goes in depth on how to use them properly.
If you'd rather not wire it up yourself there are also ESP32 dev boards with built-in battery management functionality, such as the LoLin32 Lite and Sparkfun ESP32 Thing. I haven't had much luck with the former (possibly due to its lack of RF shielding) but the latter seems to be pretty solid. I think Adafruit sells similar boards as well.
[1] https://hackaday.com/2022/10/10/lithium-ion-battery-circuitr...
Battery can be a problem as low power takes a lot more engineering than you’d imagine and being outdoors creates additional problems if you’re trying to use lithium chemistry cells when temps go below freezing.
For indoor use, I made this to power ESPhome devices from a cheap apple USB adapter: https://www.printables.com/model/703859-esp32-enclosure-with...
The Olimux ESP32-POE / wESP32 boards have a proper ethernet connection and PoE support. Means you don't need to worry about wifi coverage or power as long as you can get an ethernet cable to it - and those are cheap & easy to find in ludicrous lengths for outdoor use.
ESPHome also has deep sleep support - so for some use cases you can just wake up every x minutes/hours, connect to wifi, do thing, back to sleep for x minutes. In deep sleep a decent ESP32 board (firebeetle or tinypico) will last for months on a small lithium cell. For a quick sensor, the whole wake up/read sensor/update HA/sleep again takes a second or so depending on wifi configuration.
Useful for something on a schedule like sprinklers or slow sensors (soil humidity or whatever).
You can also wake based on interrupts, which is good for stuff where you are using a low power external sensor that does interrupts (wake ESP up if humidity gets to x) or a GPIO switch (magnetic entry/float switch/etc etc).
Firebeetles and tinypicos both have cell connectors and onboard charging directly for lithium pouch cells. You could also get a cheapo solar power bank, although you'll want to do some research to make sure the relatively light load of an ESP32 will keep it powered on.
Car "cigarette lighter" charger adapters are cheap and can take ~12V (and some even go up to 24) and give you a USB output.
https://shop.m5stack.com/products/battery-module-13-2-1500ma...
Featured yesterday on HN for being acquired by Espressif.
can you share details of the weather station please? ive been looking into gathering wind data on the cheap...
I bought a $60 weather station from Amazon where the base station generates a JSON file which it then wants to send to its own cloud servers. I firewalled it on its own, and have an ESP32 reading the JSON file off it and then sending the individual sensor readings into Home Assistant for a visual dashboard, and into Postgres which I use for my own weather-data-wrangling (eg hasn’t rained in a couple days and no rain expected from my local weather API? turn the watering system on for the gardens)
I built mine using a Hydreon Rain Gauge sensor (RG11 in my case) and combined it with an off the shelf wind sensor from AliExpress, presumably sold by Adafruit's supplier, which closes a reed switch every rotation. Everything is powered through PoE, controlled by wESP32. I spent a couple hundred bucks at most including all the mounting hardware.
It all controls an aluminum "awning" in my house that's supposed to open above certain wind speed, close when it rains.
Same here, plus a dozen or so random ESP32 variants just sitting in my electronics parts box because they're so cheap. It's incredibly freeing to just have all that hardware available at arms reach whenever you have an idea. They're surprisingly reliable and with modules like the sprinkler controller, they can be programmed to be independent so that they keep running as long as they have power. It took me months to realize that HomeAssistant microSD card had failed last time because all of my hydroponics gear just kept running.
By far the biggest time consumer has been wiring them up to DC/DC converters to drive relays in a waterproof Sockitbox. Another really useful part to keep around are wire terminal breakout boards: https://www.amazon.com/whiteeeen-Development-Expansion-ESP-W...
Also CloudFree is great for off the shelf IoT parts that can be reprogrammed with ESPHome: https://cloudfree.shop/