DIY Proposal 03 — Automation (Sonoff + Home Assistant)
Replaces: vendor_teardown/08_sensors_controls.md — vendor charges € 11 345.88 for Growlink (cloud-dependent, single-vendor lock-in) + implicit reliance on Autogrow cloud for dosing.
Plus implicitly replaces some of vendor_teardown/09_pricing_and_gaps.md "control cabinet / electric switchboard" line (€5 450) that includes Siemens software — we keep the hardware (cabinet, contactors, breakers) and replace the software layer entirely.
Strategy
Commercial-grade control without the commercial-grade vendor lock-in. Full local execution, full local logging, full local alerting. No cloud, no brand single-point-of-failure, and a complete facility-wide dashboard on a dedicated host.
Architecture
┌─────────────────────────────┐
│ Home Assistant (Pi 5 / N100)│
│ + UPS + NVMe + HA OS │
│ + daily snapshot backup │
└──────────────┬───────────────┘
│ Ethernet (wired, no WiFi)
┌───────────────────────────┼───────────────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌────────────────┐ ┌──────────────────┐
│ Sonoff iHost │ │ Tasmota WiFi │ │ ESPHome custom │
│ (Zigbee hub) │ │ devices: │ │ sensors: │
│ + Matter │ │ POW R3 (× 20) │ │ SCD41 CO₂ (× 4) │
│ │ │ 4CH Pro R3 × 8 │ │ Atlas EZO EC + pH │
└───────┬───────┘ │ TH Elite × 10 │ │ YF-S201 flow │
│ Zigbee │ SPM-Main + 4R │ │ │
▼ └────────────────┘ └──────────────────┘
SNZB-02P (25 × T/H sensors, canopy grid + above + below)
SNZB-03 (8 × water leak under AC units)
DW2 door sensors for UVC interlock
Hardware stack detail
Control host
Raspberry Pi 5 8 GB + NVMe SSD + UPS + official case
- HA OS (not Home Assistant Container — Core runs on HA OS with full add-on support)
- Wired Ethernet, no WiFi (more reliable, avoids RF competition with LED drivers)
- 1 TB NVMe for InfluxDB long-term logging + daily snapshots
- Mini-UPS (APC BX500MI or similar) → 15-minute ride-through during grid blip
- Cold-standby SD card pre-imaged with the same HA config + latest snapshot, ready to swap if the Pi dies
- Alternative: Intel N100 mini-PC (€180) for better I/O, longer SSD life, and CPU headroom for InfluxDB + Grafana. Slightly more power-hungry but more reliable.
One host running HA = the whole facility's brain. This is the single component that must not fail silently. Harden it:
- Daily automatic snapshot → local NAS + offsite (Backblaze B2)
- Watchdog reboot if HA stops responding
- Physical access: mount in a locked IP55 enclosure inside the mechanical room
Zigbee coordinator
Sonoff iHost (4 GB) running eWeLink CUBE as a dumb Zigbee coordinator that passes messages to HA via Matter bridge. The iHost's own automation engine is weaker than HA, so use it only as a coordinator.
- Alternative: ConBee II or SkyConnect USB stick directly into HA. Simpler, no extra hardware between Zigbee and HA. Recommended unless the customer wants the iHost's touch dashboard for local override.
WiFi switching
Sonoff POW R3 (25 A, 0.5 % accuracy power metering) for individual load switching:
- 1 per dehumidifier (5 total) — tracks energy, catches compressor stall
- 1 per irrigation pump and dosing pump (6 total, A / B / pH up / pH down / main feed / cleaning)
- 1 per exhaust fan if installed (4 total)
- 1 per humidifier (2 total)
- 3 spares
20 × POW R3 @ €28 = €560
Sonoff SPM-Main + 2 × SPM-4Relay stackable power meter for sub-metering a whole room with individual-channel data:
- 8 channels per stack, 20 A per channel, individual energy tracking
- Best tool for catching "which LED driver is drawing 40 % more than the others?" (early warning for impending driver failure)
- 1 stack per flowering room lighting bank
- 1 × SPM-Main + 2 × 4-Relay = €280
High-current switching — contactors, never direct
CRITICAL: do NOT switch 10 kW of LED drivers directly from any Sonoff. LED driver inrush is 60–120 A for 200 µs per fixture; a 12-fixture bank welds any 20 A relay in days.
Pattern:
- Schneider LC1D25 (25 A AC-3) or LC1D40 3-phase contactor, coil 230 VAC
- Sonoff 4CH Pro R3 in dry-contact mode (remove the power-jumper) drives the contactor coil on channel 1
- Split 12 fixtures across 3 phases (4 per phase) via the contactor's 3 poles
- Inrush current limiter (Ametherm SL32 NTC or equivalent) per phase for any bank with > 6 drivers per pole
- Channels 2–4 on the 4CH Pro free to drive the exhaust fan contactor, dehumidifier contactor, CO₂ solenoid
- Auxiliary interlock: wire contactor's normally-closed aux contact back to a Sonoff DW2 or a spare GPIO so HA knows if the contactor actually pulled in. Without feedback you're flying blind.
- Fuse the coil circuit separately (2 A)
8 × 4CH Pro R3 @ €45 = €360 8 × Schneider LC1D25 @ €55 = €440
Temperature / humidity sensing (VPD control loop)
Density rule: one sensor per 6 m² at canopy + one ambient. For a 24 m² flowering room:
- 4 × canopy grid sensors
- 1 × above-canopy (for HVAC return-air feedback)
- 1 × below-canopy (catches cold pooling and dehu dead zones)
- 6 per flowering room × 2 rooms = 12 flowering sensors
-
- 3 × veg, 3 × mothers, 2 × dry, 2 × wet, 3 × spares = 25 total
25 × Sonoff SNZB-02P Zigbee T/H @ €12 = €300
Averaging: HA min_max or custom template sensor takes median of the 4 canopy sensors (rejects one bad probe). Sonoff's eWeLink CUBE does NOT average natively in a useful way — HA is non-negotiable for real VPD control.
Battery warning: critical canopy sensors should be wired (DS18B20 + SHT31 via Sonoff TH Elite) because CR2477 coin cells die at 18 months and you don't want a sensor going dark in week 7 of flower. 6 × TH Elite with external probes @ €35 = €210, to replace the 4 critical canopy sensors per flowering room with wired versions.
CO₂ dosing + safety
Sensor: Sensirion SCD41 (NDIR, ± 40 ppm, I²C) on ESP32 running ESPHome.
- 4 × SCD41 + ESP32 + housing @ €55 = €220
- NOT the cheaper MH-Z19B — it drifts and needs manual ABC calibration every 2 weeks. SCD41 is the 2026 standard.
Actuator: CO₂ solenoid (24 V DC, fail-closed, brass body) driven by a channel on the 4CH Pro R3 or a Sonoff MINIR4 dedicated.
Logic (HA automation):
- ON when CO₂ < 900 ppm AND lights are ON AND exhaust fan is OFF
- OFF when CO₂ > 1200 ppm OR lights OFF OR exhaust ON
- Hard max-runtime cutoff: 10 min continuous → alarm, require manual reset
- Alarm → Pushover / Telegram at 2000 ppm
- Hardware-level high-CO₂ cutoff (independent of HA): €80 standalone CO₂ alarm wired into the contactor coil circuit for worker safety. Non-negotiable — a software bug in HA must not be able to trap a worker in a 4000 ppm room.
Fertigation / dosing (replacing vendor's Growlink Valve LINK)
Atlas Scientific EZO-EC + EZO-pH + temp on an ESP32 via I²C, ESPHome, publishing to HA.
- Calibrate weekly (this is the single most important ongoing task)
- 1 full Atlas EZO kit (EC + pH + temp + probes + solution) = €420
Flow: YF-S201 hall-effect flow meter per irrigation zone (6 zones matching the 6 drain systems) into an ESP32. ~€8 per flow meter × 6 = €50.
Solenoids: 24 VAC zone solenoids driven by spare channels on 4CH Pro R3 (already in the budget above). Standard commercial valves from irrigation suppliers, ~€30 each × 6 zones = €180.
Control loop: HA runs the schedule, AppDaemon or pyscript handles the dose math (target EC, pump-on-time per litre). This replaces the vendor's Autogrow IntelliDose entirely — saving €3 742 on the IntelliDose + Peripod M4 + Intellilink + tank pump + water sensor lines.
BUT: this is the one place the DIY approach is honestly weaker than the vendor. Autogrow IntelliDose is a legitimate commercial dosing controller with 10 years of refinement; our DIY Atlas + ESPHome + HA stack is ~80 % of that functionality at 30 % of the cost. For a small commercial facility with a daily-present grower, the DIY stack is acceptable. For a lights-out commercial facility, keep the IntelliDose and only replace the Growlink climate-control layer. See 04_irrigation_kept.md for the hybrid approach.
Alerting
Home Assistant alert integration → Pushover (€5 one-time) or ntfy.sh (free) → SMS / push on:
- Temperature excursion (> 28 °C or < 22 °C in flowering)
- Humidity excursion (> 70 % or < 45 % in flowering)
- CO₂ out of band
- Power meter detecting a dehumidifier draw dropping to zero (compressor dead)
- Leak sensor under an AC unit
- Door opened during lights-off
- HA itself hasn't heartbeated to an external service in 5 minutes
Without alerting, a DIY facility cannot run unattended. This is the difference between a toy and a tool.
Panel touch dashboards
Sonoff NSPanel Pro 120 (€130 each) in each room for local override: manual lights on/off, fan speed, set-point adjust without having to open the HA app. Nice-to-have, not critical.
Full BOM
| Item | Qty | Unit € | Total € |
|---|---|---|---|
| Sonoff POW R3 (25 A) | 20 | 28 | 560 |
| Sonoff 4CH Pro R3 | 8 | 45 | 360 |
| Sonoff TH Elite + AM2301 / DS18B20 probes | 10 | 35 | 350 |
| Sonoff SPM-Main + 2 × 4Relay (room sub-meter) | 1 | 280 | 280 |
| Sonoff SNZB-02P Zigbee T/H | 25 | 12 | 300 |
| Sonoff SNZB-03 water leak (under each AC) | 16 | 10 | 160 |
| Sonoff DW2 door sensors (UVC interlocks + general) | 8 | 12 | 100 |
| Sonoff iHost 4 GB | 1 | 130 | 130 |
| Schneider LC1D25 contactors | 8 | 55 | 440 |
| Ametherm SL32 inrush current limiters | 24 | 5 | 120 |
| Raspberry Pi 5 8 GB + 1 TB NVMe + UPS + case | 1 | 280 | 280 |
| Atlas Scientific EZO EC + pH + temp + probes | 1 | 420 | 420 |
| Sensirion SCD41 CO₂ sensors + ESP32 | 4 | 55 | 220 |
| YF-S201 flow meters + ESP32 | 1 set | 80 | 80 |
| Standalone CO₂ alarm (worker safety, hardware cutoff) | 2 | 80 | 160 |
| NSPanel Pro 120 touch panels | 5 | 130 | 650 |
| IP65 enclosures, glands, DIN rail | lot | — | 400 |
| 24 VDC DIN PSU + fuses + terminals + wire | lot | — | 500 |
| MG Chemicals 422B conformal coating spray | 2 | 25 | 50 |
| Subtotal | 4 610 | ||
| 15 % contingency (spares, wastage) | 690 | ||
| Automation total | ~€ 5 300 |
vs vendor €11 346 Growlink — €6 046 saving AND full local operation, no cloud dependency.
Reliability risks and mitigations
Research (see ../../research/sonoff_automation.md) identified the real failure modes:
-
Humidity kills PCBs. Sonoff boards are not conformal-coated from factory. Coat every board with MG Chemicals 422B before installing. Mount in IP65 junction boxes outside the canopy zone where possible. Silica gel packs inside each enclosure.
-
Relay welding on inrush. Always use contactors for LED banks. Add NTC inrush limiters per phase for any bank > 6 drivers.
-
RF interference from cheap LED drivers crushes 2.4 GHz WiFi. Wired Ethernet to the HA host and iHost. Pin Zigbee to channel 25 or 26 (away from typical WiFi channels). Ferrite chokes on driver DC leads.
-
Ground loops between the control cabinet and the grow room. Star-ground the cabinet, isolated DC rail for sensors, opto-isolators on Atlas EZO if drift appears.
-
Cloud dependency. Kill it entirely. Tasmota + ESPHome + LAN-mode only. Disable eWeLink cloud account, don't register devices.
-
OTA bricking. Disable automatic OTA on all Tasmota devices in production. Pin firmware. Test updates on a bench unit first. A failed OTA at 3 AM = room dark.
-
Single HA host failure = facility blind. UPS + daily snapshots + cold-standby SD card. Test the recovery procedure monthly.
-
Battery sensor death mid-flower. Wire the critical canopy sensors. Use battery sensors only for redundancy / cross-check.
-
Inspector / insurance. DIY control panels may not pass commercial electrical inspection in Malta. Get a licensed Maltese electrician to sign off the mains side — the 400 V switching cabinet must have a signed certificate, even if Claude built the logic.
-
Spare inventory: hold 15 % spares on switches, and preventively swap anything driving a pump / contactor at 12 months.
What this gets you vs Growlink
| Growlink (€11 346) | Sonoff + HA (€5 300) | |
|---|---|---|
| Cloud dependency | Yes | No |
| Local automation engine | Partial (LINK Hub) | Full (HA) |
| Brand solvency risk | High (small US company) | **None (FOSS, Nabu Casa is a 50-person HA company but fork-able) |
| Works offline | Partial | Yes, indefinitely |
| Historical logging | Cloud | Local InfluxDB + Grafana, unlimited retention |
| Third-party integration | Closed ecosystem | ~2 500 HA integrations, ESPHome for anything custom |
| Alerts | Email via cloud | Pushover + Telegram + SMS, facility-local logic |
| Sensor expansion | Proprietary M8 probes only | Any I²C / SPI / Zigbee / WiFi sensor, unlimited |
| Learning curve | Low (preconfigured) | High (requires HA + ESPHome literacy) |
| Customer dependency on the builder | Vendor support | Whoever set up HA, forever |
The last row is the real tradeoff. Sonoff + HA is a self-built custom stack. If the customer loses access to whoever built it, maintenance becomes hard. The Growlink approach trades cost + flexibility for a supported commercial stack.
Honest recommendation: this DIY approach only works if the user is staying on as the integrator (or trains the customer's own staff). If the customer is buying a turnkey facility and walking away from the builder, keep some form of commercial controller (TrolMaster Hydro-X Pro is the right tier — €12–16 k, local execution, supportable) and only DIY the non-critical subsystems.
See ../comparison/tradeoffs.md for the full honest discussion.