Open-source · Vertical farming · Energy

Grow lights that check the electricity price first.

lightshift plans when your grow lights run, using tomorrow's day-ahead electricity prices. Each zone keeps its photoperiod and DLI, all racks share one dark period, and staff always have light during the shift. Try it below with real Norwegian, Dutch and Turkish prices.

Python 3.10+ENTSO-E / Nord Pool zones15-min MTU readyFirebase syncMIT

Plan your own room

Three steps, all in your browser, on real day-ahead prices. Change any number and the schedule updates right away.

1Pick a market and a day
Last two weeks, plus tomorrow once published (about 13:00 CET)
2Describe your room

One row per zone that has its own light switch. Enter PPFD or DLI, the other one follows.

ZoneClick a name to rename itLight (h/day)PhotoperiodPPFD (µmol/m²/s)Light intensity; average when dimmingMin PPFDDimming floorMax PPFDDimming ceilingArea (m²)Canopy areaDLI (mol/m²/d)Daily light; linked to PPFDPower (kW)CalculatedOn / OffOff: zone left out
More settings
How the numbers are calculated

PPFD and DLI are linked per zone: enter either one and the other follows, with PPFD as the average over the lit hours (in dimming mode the hourly PPFD varies around it, the DLI stays the same). In dimming mode each zone keeps its photoperiod and DLI, but runs brighter in cheap hours and dimmer in expensive ones, within its min and max PPFD. The max change per hour keeps transitions gradual; the profile is the cheapest one that respects all limits (an exact linear program). Power = PPFD × area ÷ (efficacy × 0.9), assuming 90% of emitted photons reach the canopy. DLI = PPFD × photoperiod × 0.0036; the scheduler moves light in time but never changes it. Set shift start equal to shift end for no shift. Continuous light gives each zone one unbroken light period per day. Switch a zone off to leave it out of the plan.

3Read the result

Chart shows
Light on Dark period, all zones off Staff shift Dimming: darker shade = higher PPFD

How it works

Day-ahead prices are published around noon for the next day, and the rules a schedule must follow can be written down exactly. So the scheduler is two deterministic stages.

STAGE 1

Synchronized blackout

Find the most expensive continuous window outside working hours and switch every zone off together. One shared night means no rack is lit while its neighbour should be dark, so there is no light bleed across open racks, and every crop gets a protected, continuous dark period.

STAGE 2

Selective peak shedding

Place each zone's remaining light hours in the cheapest slots its rules allow. Zones are shed during the remaining spikes, each within its block and gap rules, and enough zones stay lit for staff during shifts.

# per zone g, after the blackout is fixed
minimize  Σt pricet · Pg · Δt · xg,t
subject to light(xg) − buffer · switches(xg) ≥ photoperiodg
           every on-run ≥ min block, every inner off-run ≥ min gap, #blocks ≤ max
           xg,t = 0 in the blackout, xg,t = 1 where staff light is required
# solved exactly by dynamic programming; checked against brute force in the test suite

Every zone is dark during the blackout, so the periodic day can be cut open there and solved as a linear problem with no loss of exactness. An optional exact mode tries every feasible blackout window and keeps the cheapest overall plan.

What the backtest says

Fixed baseline, lights onFixed costPrice-aware, fixed PPFDPrice-aware + dimming

Run it

Works offline with the bundled price history, or live from ENTSO-E, hvakosterstrommen.no, energy-charts.info or EPİAŞ (Türkiye).

# install
git clone https://github.com/THAYW0/vertical-farm-light-scheduler.git
cd vertical-farm-light-scheduler && pip install -e ".[plot]"

# one day of real NO4 prices, with a chart
lightshift plan --date 2026-01-15 --prices data/prices_no4_2025-12-01_2026-02-28.csv --chart schedule.png

# 90-day backtest against a fixed schedule
lightshift backtest --prices data/prices_no4_2025-12-01_2026-02-28.csv --chart backtest.png

# tomorrow, live NO4 prices, pushed to the controllers
export ENTSOE_API_TOKEN=...
lightshift plan --source entsoe --sync firebase

About

Yasar Ates
Product Engineer, Jan IngenHousz Institute
Education
MSc Biosystems Engineering, Wageningen University & Research
Now
Developing a low-cost gas analyzer
Internship
GROWY (vertical farming): temperature and VPD distribution across growing levels

Why this project

Working on climate at GROWY made me look at lighting too: it is the largest energy load, and when it runs sets both the bill and the heat the climate system has to remove. I started with local Python scripts for my own experiments, then turned them into a tested package with this page and made it a public repository, so anyone can use it, check the method or build on it.

The two-stage structure (a shared blackout, then selective peak shedding) follows the approach GFN R&D AS described publicly for their farm in Northern Norway. I wanted to see how far exact, explainable optimization can take it.

Next

  • Light and climate together: heat load, temperature and VPD across racks.
  • Grid tariffs: capacity charges, not only the spot price.
  • Farm validation: simulated vs. metered cost.

Feedback is welcome: open an issue or message me on LinkedIn.