Skip to content

JakeTheRabbit/HAGR

Repository files navigation

HAGR — Home Assistant Grow Room

License: MIT Home Assistant ESPHome AppDaemon HACS

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.

Fertigation control dashboard

Contents


Repository index

Automations

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.

Blueprints

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, relay-stuck safety auto-off, low and high alerts with cooldowns, optional light auto-dim on sustained low CO₂.
grow_room_env_threshold_alerts.yaml One blueprint, all your environmental alerts. Separate day/night thresholds, pause switch, persistence delay, cooldown between notifications, multi-device notify targets.
auto_temp_triggered_light_dimming.yaml When the room overheats, dim the lights and keep dimming until temp comes back. 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.

Packages

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/ A four-phase (P0/P1/P2/P3) crop-steering package — input helpers, template sensors, automations, and a long user guide. Start with Packages/ReadMe.MD and crop_steering_installation_guide_improved.md.

Two standalone YAMLs sit at the repo root and can be !included into your own setup:

ESPHome configs

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.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 + PWM unit Dim a 0-10 V or PWM LED driver as a native HA light entity. Wired in place of the potentiometer.
espatom_mlx90640.yaml M5Stack Atom Lite + MLX90640 32 × 24 thermal IR array for canopy temperature mapping.
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.

Add-ons

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.

Hardware notes

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.

Growing SOPs

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.

Root-level files

File What it does
automated_batch_tank.md System diagram and the full automation for batch-tank fill and dose.
athena.html Standalone single-file Athena Pro Line batch-tank calculator. The hosted version lives at batch_tank_calculator.
crop_steering_package.yaml Earlier single-file crop-steering snapshot. For new installs use Packages/CropSteering/.
vpd_configuration.yaml Leaf and air VPD template sensors.
PARTS_LIST.md Bill of materials — sensors, valves, plugs, microcontrollers, drivers.

Related repositories

The wider system, broken into focused repos. Some are reference implementations, some are the production code, some are companion tools.

Crop steering and irrigation

Repo What it is
HA-Irrigation-Strategy A proper multi-zone (1-6) crop-steering controller for Home Assistant. Custom integration plus AppDaemon modules. Phase state machine, VWC/EC-driven irrigation, full dashboards. The most actively developed crop-steering setup in this ecosystem.
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.
irrigation_unlimited Fork of the Irrigation Unlimited HA integration (rgc99), pinned for the irrigation stack.

Calculators and tools

Repo What it is
batch_tank_calculator Athena Pro Line batch-tank nutrient calculator — metric and imperial, scales to any reservoir volume, persists calculations to local storage, exports to CSV. Live site.
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.
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.

Infrastructure and integrations

Repo What it is
mosquitto-bridge-setup Mosquitto bridge configuration for dual-boot Windows/Linux relaying. Useful when a no-auth nutrient doser has to talk to authenticated HA MQTT.
visitors_repo A small visitor sign-in / sign-out tracker for HA. Built to be quick and to not get tangled up when visitors forget to sign out.
rosinlab Local-first rosin press and sift logging web app. Embeds inside Home Assistant via an iframe card. Compare mode plays up to three press videos side by side with parameters.
TDR-Sensor The newer dedicated repo for TEROS-12 and compatible SDI-12 substrate sensor builds. Supersedes the teros-12/ folder here.

What it does

The stack covers:


The HA stack

Everything below is what actually runs the build. Each entry links to its source.

Add-ons

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.

Core integrations

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

HACS — custom integrations (50 installed)

Integration Repo
AC Infinity dalinicus/homeassistant-acinfinity
AC Infinity (AI+ Optimized) JoshuaSeidel/homeassistant-acinfinity
Alarmo nielsfaber/alarmo
Alexa Media Player alandtse/alexa_media_player
Auto Arm rhizomatics/autoarm
Average Sensor Limych/ha-average
Bermuda BLE Trilateration agittins/bermuda
Beszel API Ronjar/beszel-ha
Better Thermostat KartoffelToby/better_thermostat
Browser Mod thomasloven/hass-browser_mod
Chore Helper VolantisDev/ha-chore-helper
Crop Steering System JakeTheRabbit/HA-Irrigation-Strategy
Daily Sensor jeroenterheerdt/HADailySensor
Device Pulse studiobts/home-assistant-device-pulse
Dual Smart Thermostat swingerman/ha-dual-smart-thermostat
Favicon Changer thomasloven/hass-favicon
Frigate blakeblackshear/frigate-hass-integration
HACS hacs/integration
HASS.Agent hass-agent/HASS.Agent-Integration
HVAC Group tetele/hvac_group
IntesisHome jnimmo/hass-intesishome
LLM Vision valentinfrlch/ha-llmvision
LocalTuya rospogrigio/localtuya
Magic Areas jseidl/magic-areas
MeasureIt danieldotnl/ha-measureit
MetService New Zealand Weather ciejer/metservice-weather
Mold Risk Index Strixx76/mold_risk_index
Network Scanner parvez/network_scanner
Node-RED Companion zachowj/hass-node-red
ntfy.sh Notifications ivanmihov/homeassistant-ntfy.sh
OpenAI GPT-4o Mini TTS wifiuk/OpenAI-GPT-4o-Mini-TTS-Home-Assistant-Integration
OpenAI TTS sfortis/openai_tts
OpenAI Whisper API einToast/openai_stt_ha
OpenClaw techartdev/OpenClawHomeAssistantIntegration
Passive BLE Monitor custom-components/ble_monitor
PID Controller soloam/ha-pid-controller
Powercalc bramstroker/homeassistant-powercalc
Pyscript Python Scripting custom-components/pyscript
Scheduler Component nielsfaber/scheduler-component
Simple Inventory blaineventurine/simple_inventory
Sonoff (LAN) AlexxIT/SonoffLAN
Spook frenck/spook
Spotify Voice Assistant Search cauld/spotify-voice-assistant
Supernotify rhizomatics/supernotify
Tuya Local make-all/tuya-local
Ubiquiti EdgeOS Routers elad-bar/ha-edgeos
Variable snarky-snark/home-assistant-variables
Watchman dummylabs/thewatchman
xAI Conversation pajeronda/xai_conversation
xAI Grok Conversation braytonstafford/grok_conversation

HACS — frontend cards (43 installed)

Card Repo
Advanced Camera Card dermotduffy/advanced-camera-card
Alarmo Card nielsfaber/alarmo-card
Anchor Card ShadowAya/anchor-card
Bar Card custom-cards/bar-card
Battery State Card maxwroc/battery-state-card
Bubble Card Clooos/Bubble-Card
Button Card custom-cards/button-card
Card-mod thomasloven/lovelace-card-mod
Custom Card Features Nerwyn/custom-card-features
Custom Icon Color Mariusthvdb/custom-icon-color
Elapsed Time Card Kirbo/ha-lovelace-elapsed-time-card
Energy Overview Card Sese-Schneider/ha-energy-overview-card
Floorplan ExperienceLovelace/ha-floorplan
Fold Entity Row thomasloven/lovelace-fold-entity-row
Horizon Card rejuvenate/lovelace-horizon-card
Layout Card thomasloven/lovelace-layout-card
LLM Vision Card valentinfrlch/llmvision-card
Lovelace Badge Card thomasloven/lovelace-badge-card
Lovelace Canary jcwillox/lovelace-canary
Mini-Climate Card artem-sedykh/mini-climate-card
Mini-Graph Card kalkih/mini-graph-card
Modern Circular Gauge selvalt7/modern-circular-gauge
More Info Card thomasloven/lovelace-more-info-card
Multiple Entity Row benct/lovelace-multiple-entity-row
Mushroom piitaya/lovelace-mushroom
Navbar Card joseluis9595/lovelace-navbar-card
Numberbox Card junkfix/numberbox-card
Paper Buttons Row jcwillox/lovelace-paper-buttons-row
Plotly Graph Card dbuezas/lovelace-plotly-graph-card
Psychrometric Chart Advanced guiohm79/psychrometric-chart-advanced
Scheduler Card nielsfaber/scheduler-card
Slider Entity Row thomasloven/lovelace-slider-entity-row
Stack-in-Card custom-cards/stack-in-card
TDV Bar tdvtdv/ha-tdv-bar
Template Entity Row thomasloven/lovelace-template-entity-row
Text Divider Row iantrich/text-divider-row
TimeFlow Card Rishi8078/TimeFlow-Card
Timer Bar Card rianadon/timer-bar-card
Timeline Card weedpump/timeline-card
Vertical Stack-in-Card ofekashery/vertical-stack-in-card
Weather Chart Card mlamberts78/weather-chart-card
Week Planner Card FamousWolf/week-planner-card
AC Infinity Lovelace Card JoshuaSeidel/hass-acinfinity-lovelace-card

HACS — template helpers (3 installed)


External resources

Crop steering and irrigation

Sensors and firmware

Nutrient calculators

  • Hydrobuddy — open-source hydroponic nutrient calculator.
  • Open Salts — ingredient breakdowns of common commercial nutrients.

Growing guides

Adjacent open-source projects

  • OpenTHC — open cannabis-industry standards and tooling.
  • farmOS — open-source farm record-keeping.
  • OpenFOAM — CFD modelling, useful for airflow simulation.

Screenshots

Dashboard overview Environment config Crop steering config

Peri-pump automatic batch-tank filling:

Batch tank filling

A note on secrets

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.

MIT licensed.

About

Home Assistant automated hydroponic grow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors