A private project: the watering in my garden runs by itself. Several ESP32 boards with ESPHome firmware measure, decide and switch, and everything is connected to Home Assistant, which shows the state and lets me override it from the phone:
- a rain-barrel monitor: water level from a float switch and two capacitive probes, and a pump;
- a greenhouse soil-moisture and temperature monitor;
- a 3-zone sprinkler controller;
- two 4-channel switch boards, one of them also measuring temperature.
Each board has its own configuration, and the shared parts (Wi-Fi, OTA updates, web server, logging, diagnostics such as signal strength and uptime) are ESPHome packages included by every board. Passwords stay in per-board secret files outside git.
Details#
- Consistent water levels. Template sensors make the barrel levels agree with each other: if water reaches a higher sensor, every lower level reads as wet too, whatever a noisy probe says. The analog probes use hysteresis.
- Calibrated soil sensors. I measured 20 capacitive soil-moisture sensors dry and in water, and derived a linear formula from the raw ADC value to a moisture percentage.
- One tool for all boards.
board.py(run with uv) lists the boards and serial ports, compiles, uploads over USB or over the network, and shows logs, for one board or all of them, on Windows and macOS.