Fish-o-mat: An Aquaponics Greenhouse Controlled by ESPHome and Home Assistant

Two self-designed controller boxes, 3D-printed fish feeders and a Home Assistant dashboard keep an aquaponics greenhouse running – fully local, with PV surplus heating.

5 Min. Lesezeit

The Problem

Aquaponics combines fish farming and plant cultivation in one water cycle: the fish produce nutrients, bacteria convert them, and the plants clean the water that flows back to the fish. In my greenhouse two separate systems – a left and a right side – are running, each with its own fish tank, grow bed and vertical pipe towers for lettuce. The fish are catfish.

Such a system only works if a handful of things run reliably, day and night, all year round:

  • the water pump has to keep the water circulating,
  • the air pump has to keep enough oxygen in the water,
  • the water temperature has to stay in a narrow range – in winter the greenhouse gets cold, in summer it gets hot,
  • and the fish have to be fed regularly and in the right amount.

Commercial controllers are either expensive, cloud-bound or impossible to integrate into an existing home automation. I wanted a solution that runs locally, uses cheap standard components, alerts me when something goes wrong and integrates into my Home Assistant installation – and ideally heats the water with solar surplus instead of grid power.

The Solution

The greenhouse shortly after the setup

The picture shows the greenhouse shortly after the setup – the pipe towers are still waiting for their plants. It holds two identical systems. On the back wall a board carries the air pumps, the power distribution, an energy meter and the two controller boxes. Above each fish tank sits a 3D-printed automatic fish feeder; the lettuce grows in the gravel beds on top of the tanks and in the vertical pipe towers on both sides.

The controller: Fish-o-mat

Two Fish-o-mat V0.1 controller boxes

Each side has its own Fish-o-mat – a controller box built around an ESP32 running ESPHome. Each box contains:

  • an ESP32-D1 mini connected via WiFi
  • a 4-channel relay module with four potential-free contacts (230 V / 10 A each) for heating, cooling, air pump and water pump
  • a 1-Wire bus (VCC, DQ, GND) for the temperature sensors – air temperature and substrate/water temperature
  • a 5 V USB power supply for the electronics and terminals for the 230 V supply

All mechanical parts are designed by myself and produced with the tools of smart production: the mounting plate is laser-cut from plywood with all connections engraved directly on it (“USB Netzteil (5V)”, “4x Potentialfreie Kontakte zu je 230V/10A”, the reset button …), so maintenance is easy even years later. The fish feeders are 3D printed (model on MakerWorld, firmware on GitHub). Everything sits in standard IP-rated junction boxes.

Caution: These boxes switch mains voltage. Work on 230 V installations must only be carried out by qualified persons.

Firmware

The firmware is a plain ESPHome configuration: the temperature sensors and the four relays are declared in a few lines of YAML, and ESPHome makes them available to Home Assistant via its native API – no MQTT broker or custom code required. The control logic itself (thermostat, timers, PV surplus) lives in Home Assistant.

Home Assistant

Home Assistant dashboard of the aquaponics greenhouse

The dashboard mirrors the physical layout: the left system on the left, the right system on the right, shared information in the middle.

  • Per side: air and substrate temperature, the state of heating, cooling, air pump and water pump, and a thermostat that keeps the water between 25 and 27 °C. Light, feed now and clear jam are available as buttons.
  • PV surplus heating: a switch per tank lets the heating run on solar surplus, so the water is warmed with energy that would otherwise be fed into the grid.
  • Energy: the greenhouse power supply can be switched centrally; current power and total energy consumption are measured.
  • Stock information: from the total fish weight Home Assistant calculates the average weight, the daily growth and the required amount of food per day (feeding rate 3.5 % of the body weight).
  • Feeding: the automatic feeding can be switched on and off; a chart shows the weight of both food reservoirs, so you can see at a glance whether each feeding actually happened.
  • Camera: a live view of the greenhouse.

The result

Basil growing in the pipe towers

The fish supply the fertilizer, the system does the rest: in summer basil fills the pipe towers, and tomatoes and cucumbers grow up to the roof of the greenhouse.

The greenhouse in summer

And of course the fish are part of the harvest as well:

Harvested catfish Catfish fillet with potato wedges

Conclusion

After one full season (March to November) these are my take-aways:

  • Heating is a must in spring and autumn. From March to April and again from September the water has to be heated. That added up to about 2 MWh of electricity – all of it solar power from my own PV system, which is exactly why the PV surplus switch exists.
  • Cooling is a must in summer. On sunny days the greenhouse reaches peaks of more than 50 °C.
  • Zero tolerance for errors. Plants and fish are living beings: a pump that stops or a heater that gets stuck can wipe out a whole season. Reliable hardware and alerts are not optional.
  • About one hour of work per week, averaged over the season: measuring water parameters, cleaning filters, harvesting and cleaning up.
  • Growth is exponential – and so is the cleaning effort. The upside: the fertilizer gain grows as well, and the garden is grateful.

Power consumption of the greenhouse from March to November

The numbers of one season

Fish foodabout 65 kg (99 % commercial food with 48 % protein and 13 % fat; the rest brewer’s grains, worms …)
Yield fishabout 55 kg of catfish (≈ 25 kg fillet)
Yield vegetables0.5–3 kg per week, about 50–70 kg per season
Costs fish (fingerlings)about € 75
Costs foodabout € 120
Costs electricity€ 0 thanks to the own PV system (otherwise about € 600)
Careabout 40 h per season, plus one weekend for planting and winterizing and one weekend for harvesting and preserving the fish

Building the system was a one-time effort of about 200 hours for the greenhouse including the foundation and about 100 hours for planning and developing the concept – including roughly 40 hours for building and testing the fish feeder, 20 hours for the ebb-and-flow siphon and 10 hours for the solids filter.

Doing it yourself is the key to cost efficiency – and building it is half the fun.