This guide provides a complete overview of all Home Assistant automations used to manage a smart grow tent environment. Whether you're growing cannabis, herbs, or vegetables, these automations allow precise control over light, humidity, temperature, ventilation, and growth phases.
Why automate your grow tent? Manually juggling lights, fans, and sensors leads to inconsistencies and stress—for you and your plants. A Home Assistant–driven system instead:
Over time you’ll see healthier root zones, denser foliage, and a more predictable yield—all while logging data for continuous improvement.
All examples below are written in YAML format and can be directly imported or adapted into Home Assistant. The system uses phases such as Keimling
(Seedling), Wachstum
(Vegetative), and Blüte
(Flowering), each with its own logic.
Each component plays a critical role:
input_select.growbox_phase
drives all triggers—no need for separate automations per device.
sensor.temperatur
, sensor.luftfeuchtigkeit
light.growbox
input_select.growbox_phase
Plants sense not only light intensity but also the quality and duration of that light. By gradually ramping up/down over 30 – 60 minutes, you:
Consistency is key—if power blips occur or you restart HA, the “verification” automations later will restore correct light states based on time and phase.
Each grow phase has its own simulated sunrise and sunset routine. These automations gradually increase or decrease the light brightness based on the current growth phase, using input_select.growbox_phase
and the number of days since the phase started.
Increases light from 8% to 27% between 06:00 and 06:30 every day.
alias: Growbox - Sunrise Seedling Phase (30min)
description: Gradual light increase from 8% to 27% between 06:00–06:30 during seedling phase.
trigger:
- platform: time
at: "06:00:00"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Keimling"
action:
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: 8
- delay: "00:30:00"
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: 27
mode: single
Fades the light down to 0% (off) at the end of the day.
alias: Growbox - Sunset Seedling Phase (30min)
description: Gradual light decrease to 0% at 23:30 during seedling phase.
trigger:
- platform: time
at: "23:30:00"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Keimling"
action:
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: 15
- delay: "00:15:00"
- service: light.turn_off
target:
entity_id: light.growbox
mode: single
The first two weeks—your “Seedling Phase”—are all about establishing a secure root network. Light levels under 30%:
A gradual sunrise/sunset helps synchronize the plant's internal clock, preparing it for more intense light later.
During the Vegetative phase, brightness increases each day by 7%, starting from 28% and capped at 55%:
Days since Vegetative Start | Brightness (%) |
---|---|
0 | 28 |
1 | 35 |
2 | 42 |
3 | 49 |
≥ 4 | 55 (maximum reached) |
Formula: brightness = min(28 + 7 × days, 55)
From 28% on day 1 to 55% after 4 weeks.
During the Vegetative Stage (weeks 2–6), plants transition from root establishment to vigorous leaf production. The daily increase of 7% helps overcome self-shading of the expanding canopy.
Adjust the increment if using higher-output LEDs or different cultivars.
The Vegetative stage is when the plant’s foliage expands rapidly. To provide enough light for lower leaves while preventing photoinhibition, the brightness is ramped up gradually.
For example, using the formula brightness = min(28 + 7 × days, 55)
ensures a smooth increase.
alias: Growbox - Sunrise Vegetative Phase (dynamic)
description: Increases brightness from 28% up to 55% based on days since phase start.
trigger:
- platform: time
at: "06:00:00"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Wachstum"
action:
- variables:
days: >
{{ ((as_timestamp(now()) - as_timestamp(states('input_datetime.growbox_phase_last_changed'))) / 86400) | round(0) }}
brightness: >
{% set base = 28 %}
{% set step = 7 %}
{% set max = 55 %}
{% set calc = base + (days * step) %}
{{ [calc, max] | min }}
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: "{{ brightness }}"
mode: single
Flowering requires strict photoperiod control. In the first 21 days of Flowering, the light is maintained at 55% to allow initial bud formation. After day 21, the intensity increases to 80% to stimulate resin production and bud growth.
Pro tip: Keep light leaks below 5 lux during the dark period.
The light starts at 55% and increases to 80% starting in week 3.
Maintaining a strict schedule is essential. For the first 21 days, a moderate intensity of 55% allows stable bud initiation. After 21 days, the intensity increases sharply to 80% to boost flowering.
This controlled jump minimizes shock and ensures optimal flowering conditions.
alias: Growbox - Sunrise Flowering Phase
description: Light starts at 55% and increases to 80% after 3 weeks.
trigger:
- platform: time
at: "08:30:00"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Blüte"
action:
- variables:
days: >
{{ ((as_timestamp(now()) - as_timestamp(states('input_datetime.growbox_phase_last_changed'))) / 86400) | round(0) }}
brightness: >
{% if days >= 21 %} 80
{% else %} 55
{% endif %}
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: "{{ brightness }}"
mode: single
Ensures the light turns off exactly at 20:00 to maintain the dark period.
alias: Growbox - Sunset Flowering Phase (hard off)
description: Turns off grow light at 20:00 sharp during flowering phase.
trigger:
- platform: time
at: "20:00:00"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Blüte"
action:
- service: light.turn_off
target:
entity_id: light.growbox
mode: single
Time → 6h 12h 18h 24h | | | | Seedling: 🌅───☀──────────🌇 Vegetative:🌅────🌤─────────🌇 Flowering: 🌅──☀──🌇
Illustrates the on/off periods and sunrise/sunset transitions for each phase.
[Seedling & Vegetative (18h Light / 6h Dark)] Light: 06:00 ───────────────────── 00:00 Dark: 00:00 ────── 06:00 [Flowering (12h Light / 12h Dark)] Light: 06:00 ───────── 18:00 Dark: 18:00 ───────── 06:00
Note: In the Seedling and Vegetative phases, the plants receive 18 hours of light and 6 hours of darkness. In the Flowering phase, the light period is reduced to 12 hours with 12 hours of darkness.
These automations ensure that the light is at the correct intensity at the expected times. They act as backups if any sunrise/sunset routine fails.
Ensures the light is on at 25% brightness at 06:30 during the Seedling phase.
alias: Growbox - Check Light at 06:30 (Seedling)
trigger:
- platform: time
at: "06:30:00"
condition:
- condition: and
conditions:
- condition: state
entity_id: input_select.growbox_phase
state: "Keimling"
- condition: numeric_state
entity_id: light.growbox
attribute: brightness
below: 64 # 25% brightness on a 0–255 scale
action:
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: 25
mode: single
Turns the light off at midnight as a fallback.
alias: Growbox - Midnight Light Off Check
trigger:
- platform: time
at: "00:00:00"
condition:
- condition: state
entity_id: light.growbox
state: "on"
action:
- service: light.turn_off
target:
entity_id: light.growbox
mode: single
Verifies the light brightness during the Flowering phase.
alias: Growbox - Light Check 08:30 (Flowering)
trigger:
- platform: time
at: "08:30:00"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Blüte"
action:
- variables:
days: >
{{ ((as_timestamp(now()) - as_timestamp(states('input_datetime.growbox_phase_last_changed'))) / 86400) | round(0) }}
brightness: >
{% if days >= 21 %} 80
{% else %} 55
{% endif %}
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: "{{ brightness }}"
mode: single
Turns the light off if the sunset routine fails.
alias: Growbox - Light Off Check 20:00 (Flowering)
trigger:
- platform: time
at: "20:00:00"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Blüte"
action:
- service: light.turn_off
target:
entity_id: light.growbox
mode: single
Regularly checks and adjusts the light brightness if necessary.
alias: Growbox - Light Correction Every 15min
trigger:
- platform: time_pattern
minutes: "/15"
condition:
- condition: state
entity_id: light.growbox
state: "on"
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.growbox_phase
state: "Keimling"
sequence:
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: 25
- conditions:
- condition: state
entity_id: input_select.growbox_phase
state: "Wachstum"
sequence:
- variables:
days: >
{{ ((as_timestamp(now()) - as_timestamp(states('input_datetime.growbox_phase_last_changed'))) / 86400) | round(0) }}
brightness: >
{% set base = 28 %}
{% set step = 7 %}
{% set max = 55 %}
{% set calc = base + (days * step) %}
{{ [calc, max] | min }}
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: "{{ brightness }}"
- conditions:
- condition: state
entity_id: input_select.growbox_phase
state: "Blüte"
sequence:
- variables:
days: >
{{ ((as_timestamp(now()) - as_timestamp(states('input_datetime.growbox_phase_last_changed'))) / 86400) | round(0) }}
brightness: >
{% if days >= 21 %} 80
{% else %} 55
{% endif %}
- service: light.turn_on
target:
entity_id: light.growbox
data:
brightness_pct: "{{ brightness }}"
mode: single
Vapor Pressure Deficit (VPD) measures the “dryness” of the air—the difference between the moisture the air can hold and what it actually holds. It’s essential for:
Phase | Ideal VPD (kPa) |
---|---|
Seedling | 0.45 – 0.6 |
Vegetative | 0.8 – 1.2 |
Flowering | 1.0 – 1.4 |
Assuming: Temperature = 25 °C and Relative Humidity = 60% → VPD ≈ 1.2 kPa
The following table shows approximate values for Saturation Vapor Pressure (SVP) and calculated VPD:
Temperature (°C) | SVP (kPa) | Relative Humidity (%) | Actual Vapor Pressure (kPa) | VPD (kPa) |
---|---|---|---|---|
20 | 2.34 | 70 | 1.64 | 0.70 |
25 | 3.17 | 60 | 1.90 | 1.27 |
30 | 4.24 | 50 | 2.12 | 2.12 |
Example: At 25 °C, SVP ≈ 3.17 kPa. With 60% RH, the actual vapor pressure is ≈ 1.90 kPa and VPD is about 1.27 kPa.
VPD = Saturation Vapor Pressure (at leaf temperature) – Actual Vapor Pressure. It influences transpiration and nutrient uptake.
Leaf Temp (°C) | Sat. Vapor Pressure (kPa) |
---|---|
20 | 2.34 |
25 | 3.17 |
30 | 4.24 |
At 25 °C and 60% RH, actual vapor ≈ 1.90 kPa yields VPD ≈ 1.27 kPa – hence targeting around 1.0–1.2 kPa during Vegetative is ideal.
[Measure Temperature] --> [Calculate SVP using temperature] (SVP in kPa) │ ▼ [Measure Relative Humidity] │ ▼ [Actual Vapor Pressure = (RH/100) × SVP] │ ▼ [VPD = SVP − Actual Vapor Pressure] │ ▼ [Compare with target range for current phase]
This diagram outlines the steps to calculate VPD, essential for controlling the exhaust fan.
These automations adjust the exhaust fan speed based on VPD, ensuring proper transpiration and nutrient uptake.
Maintains VPD between 0.45 and 0.6 kPa by checking every 2 minutes.
alias: Growbox - Exhaust Fan VPD Control (Seedling)
trigger:
- platform: time_pattern
minutes: "/2"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Keimling"
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.growbox_vpd
below: 0.45
sequence:
- service: fan.turn_off
target:
entity_id: fan.abluft
- conditions:
- condition: numeric_state
entity_id: sensor.growbox_vpd
above: 0.6
sequence:
- service: fan.turn_on
target:
entity_id: fan.abluft
mode: single
Target VPD: 0.8–1.2 kPa, with checks every 10 minutes.
alias: Growbox - Exhaust Fan VPD Control (Vegetative)
trigger:
- platform: time_pattern
minutes: "/10"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Wachstum"
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.growbox_vpd
below: 0.8
sequence:
- service: fan.turn_off
target:
entity_id: fan.abluft
- conditions:
- condition: numeric_state
entity_id: sensor.growbox_vpd
above: 1.2
sequence:
- service: fan.turn_on
target:
entity_id: fan.abluft
mode: single
Target VPD: 1.0–1.4 kPa, evaluated every 15 minutes.
alias: Growbox - Exhaust Fan VPD Control (Flowering)
trigger:
- platform: time_pattern
minutes: "/15"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Blüte"
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.growbox_vpd
below: 1.0
sequence:
- service: fan.turn_off
target:
entity_id: fan.abluft
- conditions:
- condition: numeric_state
entity_id: sensor.growbox_vpd
above: 1.4
sequence:
- service: fan.turn_on
target:
entity_id: fan.abluft
mode: single
Maintains consistent airflow around the plant canopy. Behavior varies by phase.
The fan operates 30 minutes ON, then 30 minutes OFF.
Still air fosters mold and uneven heat distribution. A 30/30 cycle:
In the Flowering phase, continuous airflow is crucial.
For Seedling and Vegetative phases:
Cycle: [30 min ON] --- [30 min OFF] ___________________________ | | |––––––– ON –––––––––––– | | | |–––––– OFF ––––––––––––– | |___________________________| Time (min): 0 30 60
Note: In Flowering, the fan remains permanently ON.
alias: Growbox - Circulation Fan Cycle (Seedling & Vegetative)
trigger:
- platform: time_pattern
minutes: "/30"
condition:
- condition: or
conditions:
- condition: state
entity_id: input_select.growbox_phase
state: "Keimling"
- condition: state
entity_id: input_select.growbox_phase
state: "Wachstum"
action:
- choose:
- conditions:
- condition: state
entity_id: fan.umluft
state: "off"
sequence:
- service: fan.turn_on
target:
entity_id: fan.umluft
- conditions:
- condition: state
entity_id: fan.umluft
state: "on"
sequence:
- service: fan.turn_off
target:
entity_id: fan.umluft
mode: single
The fan remains continually on during Flowering.
alias: Growbox - Circulation Fan Always On (Flowering)
trigger:
- platform: time_pattern
minutes: "/10"
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Blüte"
action:
- service: fan.turn_on
target:
entity_id: fan.umluft
mode: single
These automations respond to changes in the grow phase (input_select.growbox_phase
), set initial fan speeds, and record phase change timestamps.
Stores the date and time of the most recent phase change for subsequent calculations.
Accurate phase transitions are critical because:
input_datetime.growbox_phase_last_changed
) enable adaptive control of light and fan speeds.
alias: Growbox - Save Timestamp When Phase Changes
trigger:
- platform: state
entity_id: input_select.growbox_phase
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.growbox_phase_last_changed
data:
datetime: "{{ now().strftime('%Y-%m-%dT%H:%M:%S') }}"
mode: single
alias: Growbox - Set Fan to 25% on Seedling Start
trigger:
- platform: state
entity_id: input_select.growbox_phase
to: "Keimling"
action:
- service: fan.set_percentage
target:
entity_id: fan.abluft
data:
percentage: 25
mode: single
alias: Growbox - Set Fan to 35% on Vegetative Start
trigger:
- platform: state
entity_id: input_select.growbox_phase
to: "Wachstum"
action:
- service: fan.set_percentage
target:
entity_id: fan.abluft
data:
percentage: 35
mode: single
alias: Growbox - Set Fan to 55% on Flowering Start
trigger:
- platform: state
entity_id: input_select.growbox_phase
to: "Blüte"
action:
- service: fan.set_percentage
target:
entity_id: fan.abluft
data:
percentage: 55
mode: single
The following YAML scripts manually control the grow light for each phase and can be triggered from the Home Assistant dashboard.
This script turns on the grow light at 25% brightness during the Seedling (Keimling) phase.
growbox_keimling_licht_morgens_einschalten_skript:
alias: "Growbox - Keimling Licht morgens einschalten (Skript)"
sequence:
- condition: state
entity_id: input_select.growbox_phase
state: Keimling
- target:
entity_id: light.growbox_licht_dimmer
data:
brightness_pct: 25
action: light.turn_on
mode: single
description: ""
This script turns off the grow light during the Seedling phase in the evening.
growbox_keimling_licht_abends_ausschalten_skript:
alias: "Growbox - Keimling Licht abends ausschalten (Skript)"
sequence:
- condition: state
entity_id: input_select.growbox_phase
state: Keimling
- target:
entity_id: light.growbox_licht_dimmer
action: light.turn_off
mode: single
description: ""
This script calculates the appropriate brightness based on the number of days in the Vegetative (Wachstum) phase (ramping from 28% toward a maximum of 55%) and turns on the light.
growbox_wachstum_licht_morgens_einschalten_skript:
alias: "Growbox - Wachstum Licht morgens einschalten (Skript)"
sequence:
- condition: state
entity_id: input_select.growbox_phase
state: Wachstum
- variables:
start: "{{ states('input_datetime.growbox_phase_last_changed') | as_datetime }}"
tage: "{{ (now() - start).days }}"
ziel: "{{ [28 + (tage / 28 * (55 - 28)), 55] | min | round(0) }}"
- target:
entity_id: light.growbox_licht_dimmer
data:
brightness_pct: "{{ ziel }}"
action: light.turn_on
mode: single
description: ""
This script turns off the grow light during the Vegetative phase in the evening.
growbox_wachstum_licht_abends_ausschalten_skript:
alias: "Growbox - Wachstum Licht abends ausschalten (Skript)"
sequence:
- condition: state
entity_id: input_select.growbox_phase
state: Wachstum
- target:
entity_id: light.growbox_licht_dimmer
action: light.turn_off
mode: single
description: ""
This script sets the light brightness during the Flowering (Blüte) phase. It calculates the brightness from 55% (for days less than 15) up to 80% once 15 or more days have passed.
growbox_blute_licht_morgens_einschalten_skript:
alias: "Growbox - Blüte Licht morgens einschalten (Skript)"
sequence:
- condition: state
entity_id: input_select.growbox_phase
state: Blüte
- variables:
tage: "{{ (now() - states('input_datetime.growbox_phase_last_changed') | as_datetime).days }}"
ziel_brightness: "{% if tage < 15 %}\n {{ (55 + (tage / 14.0 * (80 - 55))) | round(0) }}\n{% else %}\n 80\n{% endif %}\n"
- target:
entity_id: light.growbox_licht_dimmer
data:
brightness_pct: "{{ ziel_brightness }}"
action: light.turn_on
mode: single
description: ""
This script turns off the grow light during the Flowering phase in the evening.
growbox_blute_licht_abends_ausschalten_skript:
alias: "Growbox - Blüte Licht abends ausschalten (Skript)"
sequence:
- condition: state
entity_id: input_select.growbox_phase
state: Blüte
- target:
entity_id: light.growbox_licht_dimmer
action: light.turn_off
mode: single
description: ""
In emergencies or maintenance, setting the phase to "Off" ensures that all systems are turned off—preventing stray light or fans running that might stress the plants.
When the growbox phase is set to Ausgeschaltet
(Off), all connected systems are disabled for safety and power saving.
alias: Growbox - Full Shutdown When Phase Is Off
trigger:
- platform: state
entity_id: input_select.growbox_phase
to: "Ausgeschaltet"
action:
- service: light.turn_off
target:
entity_id: light.growbox
- service: fan.turn_off
target:
entity_id: fan.abluft
- service: fan.turn_off
target:
entity_id: fan.umluft
mode: single
Ensures that if HA restarts while in the "Off" phase, all systems remain off.
alias: Growbox - Apply Shutdown On HA Start
trigger:
- platform: homeassistant
event: start
condition:
- condition: state
entity_id: input_select.growbox_phase
state: "Ausgeschaltet"
action:
- service: light.turn_off
target:
entity_id: light.growbox
- service: fan.turn_off
target:
entity_id: fan.abluft
- service: fan.turn_off
target:
entity_id: fan.umluft
mode: single
This section monitors critical devices. If any sensor, fan, or light remains unavailable for more than 30 minutes, a notification is issued and the event is logged.
Triggers when an essential device is unavailable for 30 minutes.
alias: Growbox - Device Unavailable Notification
trigger:
- platform: state
entity_id:
- sensor.temperatur
- sensor.luftfeuchtigkeit
- light.growbox
- fan.abluft
- fan.umluft
to: "unavailable"
for: "00:30:00"
condition: []
action:
- service: logbook.log
data:
name: Growbox Device Unavailable
message: "{{ trigger.entity_id }} is unavailable!"
- service: input_text.set_value
target:
entity_id: input_text.growbox_ausfaelle
data:
value: >
{{ now().strftime('%d.%m.%Y %H:%M') }} – {{ trigger.to_state.name or trigger.entity_id }} unavailable.
mode: queued
alias: Growbox - Device Recovery Notification
trigger:
- platform: state
entity_id:
- sensor.temperatur
- sensor.luftfeuchtigkeit
- light.growbox
- fan.abluft
- fan.umluft
from: "unavailable"
condition: []
action:
- service: notify.mobile_app_iphone_randy
data:
message: "{{ trigger.to_state.name or trigger.entity_id }} is back online."
mode: queued
Accumulates device failures into input_text.growbox_ausfaelle
for a daily summary.
alias: Growbox - Append Failure to Daily Log
trigger:
- platform: state
entity_id:
- sensor.temperatur
- sensor.luftfeuchtigkeit
- light.growbox
- fan.abluft
- fan.umluft
to: "unavailable"
for: "00:30:00"
action:
- service: input_text.set_value
target:
entity_id: input_text.growbox_ausfaelle
data:
value: >
{{ states('input_text.growbox_ausfaelle') }}
{{ '\\n' }}{{ now().strftime('%d.%m.%Y %H:%M') }} – {{ trigger.to_state.name or trigger.entity_id }} unavailable.
mode: queued
Sends a daily summary of device failures via mobile notification.
alias: Growbox - Daily Device Failure Summary
trigger:
- platform: time
at: "20:00:00"
condition:
- condition: template
value_template: "{{ states('input_text.growbox_ausfaelle') | length > 5 }}"
action:
- service: notify.mobile_app_iphone_randy
data:
title: "Growbox - Device Failures Today"
message: "{{ states('input_text.growbox_ausfaelle') }}"
- service: input_text.set_value
target:
entity_id: input_text.growbox_ausfaelle
data:
value: ""
mode: single
Automating your grow tent using Home Assistant offers several key benefits:
A comprehensive, automated system is scalable and evolves with your cultivation needs.