🌿 Growbox Automation Suite


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:

  • Simulates natural light cycles (sunrise, sunset) to reduce plant shock
  • Keeps temperature and humidity rock-solid, boosting growth rates
  • Automatically reacts to anomalies (power blips, sensor drop-outs)
  • Leaves you free to focus on nutrients, training, and harvest planning

Over time you’ll see healthier root zones, denser foliage, and a more predictable yield—all while logging data for continuous improvement.

Designed for: Indoor grow tents with dimmable lights, fans, environmental sensors (temperature/humidity), and VPD control.

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.


⚙️ Requirements

Each component plays a critical role:

  • Sensors: Choose sensors with ±0.3 °C accuracy and ±2 % RH precision. Calibrate them in a reference chamber or against a trusted hygrometer.
  • Dimmable Light: LEDs or CMH fixtures that accept PWM or 0–10 V yield the smoothest fades. Ensure your controller supports sub-1 % increments for the softest dawn.
  • Fans: Use variable-speed fans so you aren’t forced into binary on/off cycles, reducing noise and power draw.
  • VPD Logic: Either integrate a ready-made VPD sensor or calculate it in Home Assistant via a template sensor.
  • Phase Selector: A single input_select.growbox_phase drives all triggers—no need for separate automations per device.
  • Home Assistant with YAML automation mode
  • Environmental sensors: sensor.temperatur, sensor.luftfeuchtigkeit
  • Dimmable grow lights, controlled via light.growbox
  • Fan controller (for exhaust and circulation)
  • VPD calculation or helper sensors
  • Phase control via input_select.growbox_phase

🌅 Sunrise and Sunset Automation

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:

  • Prevent photoinhibition (light shock) in sensitive seedlings
  • Encourage uniform stomatal opening at dawn
  • Reduce heat spikes at lights-on, protecting leaf tissue
  • Simulate a natural environment that your plants instinctively recognize

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.

🌱 Seedling Phase – Sunrise (06:00 to 06:30)

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

🌱 Seedling Phase – Sunset (23:30)

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

  • Encourage robust chlorophyll production without bleaching young leaves
  • Maintain VPD within the 0.45–0.6 kPa range to minimize evaporative stress
  • Create an optimal environment with 70–75 °F (21–24 °C) and 65–75% RH

A gradual sunrise/sunset helps synchronize the plant's internal clock, preparing it for more intense light later.

🌿 Vegetative Phase – Adaptive Sunrise

📈 Brightness Ramp Table

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.

  • Compensates for light loss due to canopy density
  • Maintains a consistent photosynthetic photon flux
  • Prevents sudden light spikes that could damage leaves

Adjust the increment if using higher-output LEDs or different cultivars.

Advanced Photoperiod & Light Ramp

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.

  • Base brightness: 28%
  • Increment: +7% each day
  • Maximum: 55%

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 Phase – Advanced Sunrise

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.

  • 55% initially to minimize heat stress and maximize bud initiation
  • Transition to 80% ensures maximum light for mature buds
  • Strict 12-hour darkness starting at 20:00 is crucial

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.

Flowering Phase Light Intensity Transition

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

🌸 Flowering Phase – Sunset (20:00)

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

📈 Light Schedule Diagram

Time →     6h   12h   18h   24h
           |     |     |     |
Seedling:  🌅───☀──────────🌇
Vegetative:🌅────🌤─────────🌇
Flowering:     🌅──☀──🌇
      

Illustrates the on/off periods and sunrise/sunset transitions for each phase.


📊 Detailed Daily Light Schedule

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

🧪 Light State Verification & Corrections

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.

☀️ Check Light at 06:30 (Seedling Phase)

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

🌙 Safety Off Check at 00:00 (All Phases)

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

🕗 Check Light at 08:30 (Flowering Phase)

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

🌑 Check Light Off at 20:00 (Flowering Phase)

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

🧠 Global Light Correction Every 15 Minutes

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

🌬️ VPD-Based Exhaust Fan Control


🧪 What is VPD?

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:

  • Transpiration (water uptake & nutrient delivery)
  • Mold prevention (too low VPD leads to high humidity)
  • Leaf health (excessively high VPD can dry out leaves)

🌡️ VPD Target Ranges by Phase

Phase Ideal VPD (kPa)
Seedling 0.45 – 0.6
Vegetative 0.8 – 1.2
Flowering 1.0 – 1.4

📏 Sample VPD Calculation

Assuming: Temperature = 25 °C and Relative Humidity = 60% → VPD ≈ 1.2 kPa


🔍 Extended VPD Calculation Examples

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.


🌡️ The Science of VPD

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.


🔎 VPD Calculation Process

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

🌱 Seedling Phase – VPD Control

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

🌿 Vegetative Phase – VPD Control

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

🌸 Flowering Phase – VPD Control

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

🔄 Circulation Fan Control

Maintains consistent airflow around the plant canopy. Behavior varies by phase.

Seedling & Vegetative Phase – 30/30 On/Off Cycle

The fan operates 30 minutes ON, then 30 minutes OFF.

💨 Importance of Air Circulation

Still air fosters mold and uneven heat distribution. A 30/30 cycle:

  • Mimics natural breezes to strengthen stems
  • Enhances gas exchange at the leaf surface
  • Keeps the tent’s microclimate uniform

In the Flowering phase, continuous airflow is crucial.

💨 Circulation Fan Operating Cycle

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

Flowering Phase – Fan Always On

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

📘 Phase Switching & Reset Logic

These automations respond to changes in the grow phase (input_select.growbox_phase), set initial fan speeds, and record phase change timestamps.

📅 Update Phase Change Timestamp

Stores the date and time of the most recent phase change for subsequent calculations.

📘 Importance of Accurate Phase Switching

Accurate phase transitions are critical because:

  • Cellular Synchronization: Different phases require tailored light and climate conditions to keep the plant’s internal clock in sync.
  • Resource Optimization: Precise timestamps (using input_datetime.growbox_phase_last_changed) enable adaptive control of light and fan speeds.
  • Continuous Improvement: Logged data aids in trend analysis and process refinement.
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

🌱 Set Fan to 25% When Switching to Seedling

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

🌿 Set Fan to 35% When Switching to Vegetative

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

🌸 Set Fan to 55% When Switching to Flowering

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

📜 Additional YAML Script Examples for Light Control

The following YAML scripts manually control the grow light for each phase and can be triggered from the Home Assistant dashboard.

🔆 Seedling: Turn On Light in the Morning

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

🌙 Seedling: Turn Off Light in the Evening

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

🔆 Vegetative: Turn On Light in the Morning

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

🌙 Vegetative: Turn Off Light in the Evening

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

🔆 Flowering: Turn On Light in the Morning

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

🌙 Flowering: Turn Off Light in the Evening

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


🛑 Global Shutdown Explained

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.

  • All lights are turned off
  • All fans are completely powered down (even after a restart)
  • No partial states occur

🔌 Global Shutdown on Phase: "Off"

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

🛠 Check Phase "Off" After HA Startup

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

🚨 Device Availability Monitoring

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.

📵 Notify if Device Unavailable

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

✅ Notify When Device Becomes Available Again

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

🧾 Log All Outages into Daily Summary Text

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

📬 Daily Summary at 20:00

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

Why Automate Your Growbox?

Automating your grow tent using Home Assistant offers several key benefits:

  • Consistency: Every plant receives the exact same conditions.
  • Stress Reduction: Gradual transitions lower plant shock and promote overall health.
  • Efficiency: Automated corrections maintain ideal environmental conditions to maximize yield.
  • Data-Driven Decisions: Detailed logs enable continuous process improvements.

A comprehensive, automated system is scalable and evolves with your cultivation needs.