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

One host running HA = the whole facility's brain. This is the single component that must not fail silently. Harden it:

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.

WiFi switching

Sonoff POW R3 (25 A, 0.5 % accuracy power metering) for individual load switching:

20 × POW R3 @ €28 = €560

Sonoff SPM-Main + 2 × SPM-4Relay stackable power meter for sub-metering a whole room with individual-channel data:

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:

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:

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.

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):

Atlas Scientific EZO-EC + EZO-pH + temp on an ESP32 via I²C, ESPHome, publishing to HA.

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:

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

ItemQtyUnit €Total €
Sonoff POW R3 (25 A)2028560
Sonoff 4CH Pro R3845360
Sonoff TH Elite + AM2301 / DS18B20 probes1035350
Sonoff SPM-Main + 2 × 4Relay (room sub-meter)1280280
Sonoff SNZB-02P Zigbee T/H2512300
Sonoff SNZB-03 water leak (under each AC)1610160
Sonoff DW2 door sensors (UVC interlocks + general)812100
Sonoff iHost 4 GB1130130
Schneider LC1D25 contactors855440
Ametherm SL32 inrush current limiters245120
Raspberry Pi 5 8 GB + 1 TB NVMe + UPS + case1280280
Atlas Scientific EZO EC + pH + temp + probes1420420
Sensirion SCD41 CO₂ sensors + ESP32455220
YF-S201 flow meters + ESP321 set8080
Standalone CO₂ alarm (worker safety, hardware cutoff)280160
NSPanel Pro 120 touch panels5130650
IP65 enclosures, glands, DIN raillot400
24 VDC DIN PSU + fuses + terminals + wirelot500
MG Chemicals 422B conformal coating spray22550
Subtotal4 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:

  1. 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.

  2. Relay welding on inrush. Always use contactors for LED banks. Add NTC inrush limiters per phase for any bank > 6 drivers.

  3. 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.

  4. 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.

  5. Cloud dependency. Kill it entirely. Tasmota + ESPHome + LAN-mode only. Disable eWeLink cloud account, don't register devices.

  6. 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.

  7. Single HA host failure = facility blind. UPS + daily snapshots + cold-standby SD card. Test the recovery procedure monthly.

  8. Battery sensor death mid-flower. Wire the critical canopy sensors. Use battery sensors only for redundancy / cross-check.

  9. 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.

  10. Spare inventory: hold 15 % spares on switches, and preventively swap anything driving a pump / contactor at 12 months.

Growlink (€11 346)Sonoff + HA (€5 300)
Cloud dependencyYesNo
Local automation enginePartial (LINK Hub)Full (HA)
Brand solvency riskHigh (small US company)**None (FOSS, Nabu Casa is a 50-person HA company but fork-able)
Works offlinePartialYes, indefinitely
Historical loggingCloudLocal InfluxDB + Grafana, unlimited retention
Third-party integrationClosed ecosystem~2 500 HA integrations, ESPHome for anything custom
AlertsEmail via cloudPushover + Telegram + SMS, facility-local logic
Sensor expansionProprietary M8 probes onlyAny I²C / SPI / Zigbee / WiFi sensor, unlimited
Learning curveLow (preconfigured)High (requires HA + ESPHome literacy)
Customer dependency on the builderVendor supportWhoever 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.