Backyard · Growing
Greenhouse Automation with ESPHome
A greenhouse is a solar oven with plants in it: on a still, sunny morning its temperature can run away in under an hour, and the whole crop’s mood swings on ventilation, humidity, and water. It is also a nearly perfect ESPHome project — three simple control loops, all local, all forgiving of an internet outage because the controller is in the greenhouse. This guide builds the loops (vents and fans on temperature, misting on humidity, irrigation on soil moisture), with the failsafe thinking the backyard series applies everywhere: what happens when the sensor lies, the relay sticks, or the Wi-Fi dies.
Published Nov 21, 2026
The three loops
Temperature is the urgent one. The standard actuators are a fan (switched by a relay) and a vent — motorized openers on a linear actuator for roof vents, or louver motors on side vents. The control is a thermostat with hysteresis in ESPHome: fan on at the high setpoint, vent staged a degree or two earlier, everything off at the low setpoint, with the deadband wide enough that relays are not chattering at the boundary. Humidity runs the misting line or a fogger in short pulses against a humidity floor, interlocked with temperature (misting into a cold greenhouse invites the fungal problems humidity control exists to prevent). Water is soil-moisture-driven drip on the pattern of the sprinkler build: capacitive soil sensors (the resistive kind corrodes — buy capacitive) per bed, watering windows in the cool hours, and per-zone maximum run times. Sensors are the bench’s usual citizens — a BME280 or SHT-class sensor for air temperature and humidity, in a small radiation shield so the sun is not measuring itself.
Why ESPHome, and the failsafe design
The greenhouse is where ESPHome’s on-device model earns its keep: the loops run in the controller’s own logic, so a dead router or a Home Assistant restart changes nothing for the plants; Home Assistant supervises, logs, and alerts (a high-temperature alarm to your phone is the single most valuable notification in the building). Design the failures before they happen. Sensor failure: an ESPHome sensor that stops reporting should drive the system to its safest state — for most greenhouses that is vents open and fan on in summer (a hot greenhouse kills in an hour; a cool one merely sulks), so wire the logic to fail toward ventilation. Relay failure: choose normally-open versus normally-closed wiring per actuator with the same question — which stuck state hurts less? Power failure: a small solar-charged battery for the controller is over-engineering for most; a wax-cylinder automatic vent opener — the purely mechanical kind that opens with heat and needs no electricity at all — is the classic belt-and-braces backup and belongs in the design as the layer that cannot crash. Water gets the timed-off discipline from the irrigation guides: any valve that opens must have a maximum run time enforced on-device.
Data, seasons, and restraint
Log the three loops for a season before automating aggressively: greenhouse microclimates are local knowledge (the corner that bakes, the bench that stays damp), and a week of temperature curves teaches more than any setpoint table. Seasonal changeover is a profile change — setpoints and watering windows differ between the spring hardening-off season and high summer — so keep the numbers in substitutions at the top of the YAML where they are edited like a planting calendar. Start with temperature alone, add water when the pattern is proven, and let humidity misting arrive last: it is the loop most capable of causing the problems it treats. The result is the backyard’s pattern at its best — a small building that manages its own climate, reports to the house, and asks a human only when the situation is genuinely human-sized.
Official documentation and references
- ESPHome — Thermostat climate platform — on-device hysteresis control for the fan and vent loops
- ESPHome — Soil moisture — capacitive sensing for the watering loop
Frequently asked questions
Why automate the greenhouse locally instead of with a cloud controller?
Because the failure that matters — a temperature runaway — develops in under an hour and does not wait for an internet connection. ESPHome runs the loops on the controller in the greenhouse; Home Assistant supervises and alerts.
What is the failsafe for a dead sensor?
Fail toward ventilation: if temperature data stops, the logic should default to vents open and fan on in summer — a cool greenhouse sulks, a hot one kills. A wax-cylinder mechanical vent opener is the no-electricity backup layer.
Which soil moisture sensors should I buy?
Capacitive ones. Resistive probes corrode in soil and drift within a season; capacitive sensors are the standard recommendation for anything meant to last.
Which loop should I automate first?
Temperature — it is the urgent one. Add watering once the pattern is proven, and humidity misting last: it is the loop most capable of causing the fungal problems it is meant to prevent.

