This repo is free. My 2am dryback debugging is not. If it saved you a crop, a weekend, or a nervous breakdown — buy the rabbit a bag of nutes. If it didn't, keep your money. I respect a tight nutrient budget.
A running, lived-in Home Assistant build for cannabis grow rooms. VPD-aware climate control, four-phase crop steering, automated batch-tank dosing, PWM-dimmable LEDs, ESPHome sensors everywhere, and consolidated alerting. It's also the front door to a wider set of related repos — controllers, calculators, sensor firmware, training material, infrastructure bits.
Important
HAGR is the ecosystem entry point and implementation archive. Start with the maintained project for the job, then use the configs here as field-tested reference material.
| What you need | Current home |
|---|---|
| Parts, prices, compatibility, wiring notes, and complete BOMs | Awesome Grow Room Parts |
| Crop-steering control for Home Assistant | HA-Irrigation-Strategy + f2-control |
| Athena feed, foliar, stock-tank, and pH calculations | Athena Grow Calculator |
| Evidence-linked cultivation guides | The Cannabis White Papers |
- Repository index
- Related repositories
- What it does
- The HA stack
- External resources
- Screenshots
- A note on secrets
Path: automations/
Working Home Assistant automations you can copy in, swap entity IDs, and run. Drop them into a packages/ directory or paste them into the UI editor.
Safety and alerting
| File | What it does |
|---|---|
light_leak_detection.yaml |
The single most important automation in a flowering room. Any ambient-light sensor above 1 lux during the dark period kills the grow lights and fires a critical notification. Also packaged as a blueprint. |
co2_multi_sensor_shutoff.yaml |
Closes the CO₂ solenoid if any of N room sensors reads above 1800 ppm. Catches stratified pockets that single-sensor shutoff misses. |
sensor_unavailability_watchdog.yaml |
Tells you when a temp, RH, or CO₂ sensor has been offline for ten minutes. Fail-safe closes the CO₂ solenoid if the CO₂ sensor itself dies. |
daily_safe_state_audit.yaml |
At 03:00 every night, force-closes every valve, the CO₂ solenoid, and the humidifier. Belt-and-braces sweep for stuck valves and forgotten overrides. |
CO2_low_Alert.yaml |
Actionable Android alert when CO₂ drops 300 ppm below target for five minutes, or when the CO₂ valve has been open longer than five minutes (probable empty tank). Bypasses do-not-disturb. |
Lighting and environment
| File | What it does |
|---|---|
light_acclimation.yaml |
Ramps brightness from 50% to 90% over 21 days then turns itself off. Triggered at lights-on. |
humidifier_off_at_lights_off.yaml |
Hard-pins the humidifier off when lights go off. Lets the dehumidifiers run the dark period uncontested. |
Adjust ACI Fan Speed External Sensor.md |
AC Infinity fan speed (0-10) from an external temp sensor with separate day and night targets. |
Leaf_VPD.md |
Leaf-VPD vs air-VPD, and the full control system that uses an IR leaf-temp sensor to drive a humidifier or dehumidifier. |
Irrigation and dosing
| File | What it does |
|---|---|
refill_tank_triggered_by_low_level.yaml |
Full batch-tank refill plus Athena Pro Line dose sequence. Fires on low water level, manual button, or tank-empty signal. Pre-fill, refill to volume, dose A/B/C/Bloom/Core in sequence, mix delay, pH/EC verification, completion alert. |
Automatic_batch_tank_filling_full_explainer.md |
Long-form walk-through of the refill and multi-part Athena dosing logic. |
auto dosing athena.md |
Helper definitions (EC target, solution volume) and dosing-node sequence for an Athena auto-dose workflow. |
crop steering node red flow |
Older Node-RED export of a crop-steering implementation. Most people should use Packages/CropSteering/ instead. |
Access control
| File | What it does |
|---|---|
door_open_siren.yaml |
Sounds a siren and notifies operators if a critical door stays open longer than 20 seconds. Cancels when the door closes. |
auto_door_lock.yaml |
Locks a door 20 seconds after it closes. Kills the "I forgot to lock it" failure mode. |
CO₂ blueprint imports
| File | What it does |
|---|---|
co2_automation.MD |
Import link and notes for the CO₂ control blueprint. See also blueprints/co2_control_and_alerts.yaml. |
Path: blueprints/
The same patterns as above, wrapped as Home Assistant blueprints. Import once, then point them at your entities from the UI.
| Blueprint | What it does |
|---|---|
co2_control_and_alerts.yaml |
Day/night CO₂ setpoints with hysteresis switching, high-CO₂ auto-off (primary + optional backup sensor, with control lockout), relay-stuck/empty-tank auto-off, sustained-low alerts with cooldown, and optional light auto-dim with automatic restore on recovery. |
grow_room_env_threshold_alerts.yaml |
One blueprint, all your environmental alerts. Separate day/night thresholds, pause switch, persistence delay, helper-backed cooldown between notifications, multi-device notify targets. |
auto_temp_triggered_light_dimming.yaml |
When the room overheats, step-dim the lights until temp comes back, then restore them to their pre-dim brightness. Won't switch lights on during the dark period. Plant-safe heat protection. |
light_leak_detection.yaml |
Critical light-leak alarm. Any illuminance sensor above the threshold while your lights-on binary sensor is off forces the grow lights off and runs your notify action — re-checked on restart and every minute, so a leak already present after a power blip is still caught. |
Path: Packages/
Larger feature sets bundled as Home Assistant packages. To use them, add this to your configuration.yaml:
homeassistant:
packages: !include_dir_named packages| Folder | What's inside |
|---|---|
Packages/CropSteering/ |
Legacy four-phase (P0/P1/P2/P3) crop-steering package, retained for existing installs and reference. For new installs use HA-Irrigation-Strategy with the f2-control add-on. |
Two standalone YAMLs sit at the repo root and can be !included into your own setup:
crop_steering_package.yaml— an earlier single-file snapshot of the same crop-steering logic, kept for reference.vpd_configuration.yaml— leaf-VPD and air-VPD template sensors.
Path: esphome/
Device YAMLs for the sensor and actuator nodes used in the build. Each file's header explains wiring and any quirks.
| Config | Device | What it does |
|---|---|---|
CO2_Sensor_espatoms3.yaml |
M5Stack Atom S3 Lite + SCD41 (Grove) | Roaming CO₂, temp, RH, VPD. |
SCD4x_m5stack_ESPOE_WiFi.yaml |
M5Stack ESPPoE + SCD41 | PoE-powered CO₂ sensor with VPD, daily min/max, and CO₂ alerts as template sensors. |
esphome_m5stack_scd41.yaml |
M5Stack Atom Lite + SCD41 | Compact CO₂ + environment monitor. |
m5Stack_AirQ.yaml |
M5Stack AirQ | Dual CO₂ sensors with auto-calibration, PM, RH, temperature. |
m5stack-dial-tank-monitor.yaml (README) |
M5Stack Dial + ultrasonic | Tank water level — distance and percentage, displayed on the dial mounted outside the tank. |
m5stack-dial-scales-co2-tank.yaml |
M5Stack Dial + load cell | CO₂ cylinder weight — track consumption and know when to refill. |
m5stack_dial_ec_tdr_sdi12.yaml |
M5Stack Dial + SDI-12 | Logger for SDI-12 substrate sensors (EC, VWC, temperature) with a dial readout. |
teros-12-sdi-12.yaml |
M5Stack Atom Lite (ESP32) + SDI-12 | Reads TEROS-12 and compatible SDI-12 soil sensors. Includes the calibration and pore-water EC math. |
terralink.yaml |
Growlink Terralink + M5Atom Lite | Turns a Growlink Terralink into an ESPHome node. |
atlas_wifi_hydroponics_kit.yaml |
Atlas Scientific EZO hydroponics kit on ESP32 | pH, EC, and RTD (temperature) from Atlas Scientific EZO modules. |
espoe_peristaltic_pumps.yaml |
M5Stack ESPPoE + relay/PWM | Peristaltic pump control for automated dosing. |
m5Stack ESPPOE PB HUB 2CH-DualButton-BLEproxy.yaml |
M5Stack ESPPoE + PB Hub | Two-channel switch / dual-button with BLE proxy. |
pwm_led_lights.yaml |
M5Stack Atom Lite + Atom PWM | Legacy low-voltage PWM example. Verify that the exact LED driver accepts non-isolated, common-ground PWM before connecting it; the M5Stack unit is not an isolated 0-10 V interface. |
espatom_mlx90640.yaml |
M5Stack Atom Lite + MLX90640 | Legacy 32 × 24 thermal IR config. New installs should use the maintained esphome-m5-thermal2 component. |
thermal_camera_leaf_temp.yaml |
M5Stack Atom Lite + MLX90614 | Single-pixel IR for direct leaf-surface temperature. Feeds the leaf-VPD calculation. |
THC-S Home Assistant Template Sensors calibrated for Coco coir |
HA template (not ESPHome) | Coco-coir-calibrated pwEC formula for the THC-S soil sensor. |
secrets.yaml.example |
— | Template for secrets.yaml. Copy and fill in WiFi credentials, API encryption key, and OTA password. |
Path: addons/
| Add-on | What it does |
|---|---|
addons/appdaemon/grow_monitor/ |
Grow Room Monitor — an AppDaemon app that watches seven sensor types (temp, RH, CO₂, VPD, leaf VPD, VWC, pwEC) with day/night-aware thresholds and trend analysis. Sends one consolidated, severity-graded notification with mute and pause actions rather than spamming you per sensor. Optional OpenAI integration writes a short situation summary into the alert. See Readme.MD. |
Path: teros-12/
| File | What it does |
|---|---|
teros-12/Readme.md |
TEROS-12 (and compatible SDI-12 clone) wiring, ESP32 sketch, calibration. A newer dedicated repo is TDR-Sensor. |
teros-12/EsPoE-Teros-12.ino |
Arduino sketch for the ESPPoE board reading TEROS-12 over SDI-12. |
teros-12/teros-12-sketch.ino |
Standalone Arduino sketch — has its own web UI and MQTT publishing. |
teros-12/libraries/ESP32-SDI12/ |
Bundled ESP32 SDI-12 library. |
Path: growingSOPs/
| Document | Topic |
|---|---|
cloning.md |
Cloning and propagation. |
Environment reference guide.md |
Stage-by-stage setpoint cheat sheet — temperature, RH, VPD, CO₂, PPFD, DLI. |
Derived crop signals.md |
Sensor-derived crop signals for leaf/air VPD, canopy cooling, dryback, EC trends, and Home Assistant templates. |
Indoor air flow.md |
Airflow requirements and room layout for indoor grows. |
Indoor Pathogens.md |
Common indoor cultivation pathogens — recognition, prevention, response. |
Cleaning.md |
Cleaning and sanitation procedures. |
| File | What it does |
|---|---|
automated_batch_tank.md |
System diagram and the full automation for batch-tank fill and dose. |
athena.html |
Legacy standalone Athena Pro Line calculator. Use the current Athena Grow Calculator or its source repository. |
crop_steering_package.yaml |
Earlier single-file crop-steering snapshot. For new installs use HA-Irrigation-Strategy with f2-control. |
vpd_configuration.yaml |
Leaf and air VPD template sensors. |
PARTS_LIST.md |
Permanent signpost to the maintained Awesome Grow Room Parts catalogue. |
The wider system, broken into focused repos. These are the maintained destinations; HAGR keeps older configs in place so existing links and installations do not break.
| Repo | What it is |
|---|---|
| Awesome Grow Room Parts · live catalogue | The canonical hardware catalogue. Searchable parts, observed prices, evidence tiers, I²C collision planning, ESPHome examples, safety notes, and complete build recipes. Supersedes the hand-maintained PARTS_LIST.md. |
| TDR-Sensor | Maintained TEROS-12 and compatible SDI-12 substrate-sensor firmware, calibration, analytics, dashboards, and ready-to-flash ESPHome configs. Supersedes teros-12/ for new installs. |
| Growlink TerraLink for ESPHome | Dedicated TerraLink wiring, calibration, deployment notes, and ESPHome configuration. Supersedes the standalone esphome/terralink.yaml guide. |
| esphome-m5-thermal2 | Maintained external component and ready-to-flash configs for the M5Stack Unit Thermal2. Use this instead of the legacy generic MLX90640 config for that packaged unit. |
| Repo | What it is |
|---|---|
| HA-Irrigation-Strategy | The maintained multi-room, multi-zone crop-steering controller for Home Assistant. Its custom integration handles configuration and sensor fusion; f2-control owns phase logic, hardware sequencing, safety gates, and operator dashboards. |
| f2-control | One-click Home Assistant add-on repository for the controller engine used with HA-Irrigation-Strategy. Install the integration first, then add this URL to the Home Assistant Add-on Store. |
| open-crop-steering | A Home Assistant add-on (with a Docker fallback) that turns cultivation recipes into versioned, immutable plans. Adds an AI runtime layer bounded by hard guardrails, and produces tamper-evident audit records suitable for regulated facilities. v0.1, in development. |
| Repo | What it is |
|---|---|
| Athena-Batch-Tank-Nutrient-Calculator | Current Athena calculator for feed reservoirs, foliar sprays, stock concentrates, tank life, and pH correction. Self-hosted and phone-friendly. Live site. |
| cannabis-white-papers | Maintained evidence-linked cultivation library covering propagation, crop steering, environment, plant health, irrigation, and facility quality. Read online. |
| cannabis-grow-room-levers | A systems-thinking field guide — the grow room treated as a coupled energy / moisture / carbon / salt / biology system. Eleven control levers, four balances, a lever-interaction matrix, a diagnostic chain, six common failure modes. Single self-contained HTML. Live site. |
| Grow Room Training | Training material distilled from the levers framework — a visual manual, a 15-chapter textbook with auto-scored MCQs, printable field cards, and an LLM-agent playbook for autonomous HA control. |
| Repo | What it is |
|---|---|
| plant-state-dashboard | Field guide, interactive demo, and reusable spec for dashboards that lead with plant state, leading indicators, and bounded advisories instead of raw graphs. |
| GrowScope | Home Assistant grow registry, automatic timelapse, full-resolution sensor history, recipe overlays, journals, and side-by-side grow replay. |
| grow-sensor-card | Compact Home Assistant card for displaying grow-room sensor state and thresholds. |
| cultivation-intelligence | AI cultivation intelligence platform — keeps every sensor reading and irrigation event in a time-series history, with an LLM advisory layer on top. |
The stack covers:
- CO₂ control — day/night setpoints, hysteresis, safety auto-off, low and high alerting, and an option to auto-dim lights when CO₂ is sustained low. See
blueprints/co2_control_and_alerts.yaml. - VPD calculations — live air VPD and leaf VPD via
vpd_configuration.yaml. Leaf VPD uses an MLX90614 IR temperature reading. - Automatic VPD control — drives a humidifier or dehumidifier to hold leaf VPD steady through temperature and RH drift.
- Crop steering and irrigation — the original four-phase (P0/P1/P2/P3) package remains in
Packages/CropSteering/for existing installs. New installs should use HA-Irrigation-Strategy with f2-control. - Substrate sensing — HAGR retains its original TEROS-12, TerraLink, and SDI-12 configs. For current firmware use TDR-Sensor or the dedicated TerraLink ESPHome repository, and compare probe options in Awesome Grow Room Parts.
- Nutrient dosing — peristaltic pumps run from an M5Stack ESPPoE, automated batch-tank fill, multi-part Athena Pro Line dosing, then a post-dose pH/EC verification through Atlas Scientific EZO probes. See
automated_batch_tank.mdandautomations/refill_tank_triggered_by_low_level.yaml. - Lighting — compatible low-voltage PWM drivers exposed as native HA
lightentities through the M5Stack Atom PWM. This is not an isolated 0-10 V interface; verify the exact driver's control input first. Seeesphome/pwm_led_lights.yaml. A linear PPFD acclimation ramp lives inautomations/light_acclimation.yaml. - Tank level monitoring — ultrasonic distance sensor on the tank lid with the readout on an M5Stack Dial mounted outside the tank. See
esphome/m5stack-dial-tank-monitor.yaml. - Notifications — consolidated environmental alerts with day/night thresholds, mute and pause actions, and an optional AI summary line. See
addons/appdaemon/grow_monitor/. - Fan speed control — AC Infinity fans driven from an external temp sensor. See
automations/Adjust ACI Fan Speed External Sensor.md. - AC control — IR-blaster control of a wall-mount split AC with PID, holding the room to about ±0.2 °C with regular hardware. See HA's Broadlink and SmartIR integrations.
- Thermal canopy temperature — ESP32 with an MLX90640 32 × 24 thermal array, or an MLX90614 single-pixel for spot leaf temp. For the packaged M5Stack Unit Thermal2 use esphome-m5-thermal2; the older configs remain under
esphome/.
Everything below is what actually runs the build. Each entry links to its source.
| Add-on | Source | Notes |
|---|---|---|
| AppDaemon | Community Add-ons | Hosts addons/appdaemon/grow_monitor/ and the HA-Irrigation-Strategy AppDaemon modules. |
| ESPHome Device Builder | Official | Flashes and manages every sensor and actuator in esphome/. |
| Frigate NVR | Frigate | Object-detection NVR. |
| Matter Server | Official | Matter device support. |
| Mosquitto Broker | Official | MQTT broker. Used by ESPHome, Zigbee2MQTT, and the custom doser. |
| NetBird | NetBird | WireGuard-based mesh VPN. |
| Node-RED | Community Add-ons | Used by automations/crop steering node red flow. |
| OpenClaw Assistant | OpenClaw | Companion add-on for the OpenClaw integration. |
| Whisper | Official | Local speech-to-text for the voice assistant pipeline. |
| Z-Wave JS | Official | Z-Wave controller. |
| Zigbee2MQTT | Z2M | Zigbee bridge. Runs in parallel with ZHA on a second radio. |
| Visitors | This org | Visitor sign-in / sign-out web app. |
Integrations you actually have to set up — default_config auto-loaders aren't listed.
Grow-room directly relevant
| Integration | Source / docs |
|---|---|
| AC Infinity | HACS custom integration |
| Better Thermostat | HACS custom integration |
| Crop Steering System | HACS custom integration |
| ESPHome | Core integration |
| Frigate | HACS custom integration |
| Generic Hygrostat | Core integration |
| Generic Thermostat | Core integration |
| HVAC Group | HACS custom integration |
| InfluxDB | Core integration |
| Local Calendar | Core integration |
| Local To-do | Core integration |
| MQTT | Core integration |
| MetService NZ Weather | HACS custom integration |
| Mobile App | Core integration |
| Powercalc | HACS custom integration |
| Scheduler | HACS custom integration |
| Template | Core integration |
| ZHA | Core integration |
| Zigbee2MQTT | Add-on + MQTT integration |
| Z-Wave JS | Core integration |
The rest of the house
Click to expand
| Integration | Source / docs |
|---|---|
| Alarmo | HACS custom integration |
| Alexa Media Player | HACS custom integration |
| Ambient Network | Core integration |
| Anthropic / OpenAI / Grok / Google Generative AI | Conversation agents |
| Apple TV | Core integration |
| Bermuda BLE Trilateration | HACS custom integration |
| Bluetooth / iBeacon | Core integration |
| CO2 Signal | Core integration |
| EdgeOS | HACS custom integration |
| Generic Camera | Core integration |
| go2rtc | Core integration |
| HACS | Custom integration manager |
| HASS.Agent | HACS custom integration |
| Husqvarna Automower BLE | Core integration |
| Google Sheets / Google Translate | Core integration |
| LLM Vision | HACS custom integration |
| LocalTuya | HACS custom integration |
| Magic Areas | HACS custom integration |
| Matter | Core integration |
| Music Assistant | Core integration |
| Network Scanner | HACS custom integration |
| Node-RED Companion | HACS custom integration |
| OpenAI TTS | HACS custom integration |
| OpenClaw | HACS custom integration |
| Passive BLE Monitor | HACS custom integration |
| Reolink | Core integration |
| RuuviTag BLE | Core integration |
| Shelly | Core integration |
| Shopping List | Core integration |
| Simple Inventory | HACS custom integration |
| Sonoff (LAN) | HACS custom integration |
| Spook | HACS custom integration |
| Switch as X | Core integration |
| Synology DSM | Core integration |
| TP-Link Kasa | Core integration |
| Tuya | Core integration |
| Tuya Local | HACS custom integration |
| Uptime Kuma | Core integration |
| Victron BLE | Core integration |
| Watchman | HACS custom integration |
| Wyoming | Core integration |
| Xiaomi BLE | Core integration |
| Yale / Yale BLE | Core integration |
- Petro31/easy-time-jinja — Jinja-friendly time formatting.
- SirGoodenough/Availability-Template — reusable
availabilitytemplate for template entities. - TheFes/relative-time-plus — richer relative-time strings.
- Killerherts/nodeRed-HA-GrowingFunctions — Node-RED flows for HA grow automation.
- jeemers/Homegrown-Assistant — A great HA + ESPHome crop-steering reference.
- Intergalactic-XYZ/awesome-cropsteering — Curated awesome-list.
- cropsteering/OS-SDI12 — Raw SDI-12 to MQTT, no Home Assistant required.
- Awesome Grow Room Parts — maintained catalogue, compatibility data, evidence tiers, build recipes, and current purchasing links.
- Chill-Division/M5Stack-ESPHome — M5Stack ESPHome configurations for indoor gardening.
- Chill-Division/sdi12-substrate-sensor — Calibrated SDI-12 substrate sensor with MQTT auto-discovery. Use this rather than rolling your own TEROS-12.
- kromadg/soil-sensor — THC-S soil-sensor reference.
- M5Stack sensors — most of the hardware in this repo.
- Hydrobuddy — open-source hydroponic nutrient calculator.
- Open Salts — ingredient breakdowns of common commercial nutrients.
- Grodan Cannabis Edition 2024 (PDF)
- Athena Pro Line Handbook (issuu)
- Growlink Crop Steering primer
- Ultimate Grow Room HVAC Guide (PDF)
- Grow-room airflow CFD walkthrough (YouTube)
- How to splice sensor wires properly (YouTube)
- OpenTHC — open cannabis-industry standards and tooling.
- farmOS — open-source farm record-keeping.
- OpenFOAM — CFD modelling, useful for airflow simulation.
Peri-pump automatic batch-tank filling:
The ESPHome configs under esphome/ still have device-specific credentials inline in places — API encryption keys, OTA passwords, WiFi AP fallback passwords. Before flashing anything in production, swap those for !secret references backed by a per-device esphome/secrets.yaml. Start from esphome/secrets.yaml.example and never commit the real secrets.yaml.
If you're forking this for your own build, rotate any credential you inherit from a committed example.
Still a work in progress. Issues and pull requests are welcome.