ED.GEN.RANGE
Generation time series by technology — average power (MW) or total energy (MWh).
Signature
ED.GEN.RANGE([tech], [start], [end], [agg], [headers], [noDate], [tz], [unit])Description
Generation time series by technology. Tech codes: 1=solar_pv, 2=wind, 3=nuclear, 4=hydro, 5=combined_cycle (gas), 6=coal, 7=solar_thermal, 8=total, 9=renewable, 10=thermal, 11=fossil — plus string aliases for ENTSO-E-only techs (biomass, oil, geothermal, etc.). Full list in the value table below.
Aggregation is controlled by agg: 0=native, 5min/10min/15min, 1=hourly, 2=daily (default), 3=monthly, 4=quarterly, 5=semiannual, 6=annual, 7=total. Native is 5-minute, so requesting 0 or "5min" for a long window can return many rows — keep date ranges narrow at sub-hourly granularity.
**Unit (unit parameter):** by default each bucket holds the AVERAGE power in MW over the bucket. That's the right number for power-curve analysis but it's NOT the energy generated — "annual generation 3500 MW" doesn't mean 3500 MWh, it means 3500 MW × 8760 h ≈ 30.7 TWh. Pass unit="MWh" to get the total energy delivered in each bucket directly. The conversion uses each metric's native sampling interval (5 min for ESIOS Spain gen/demand, 15 min for balancing, 60 min for ENTSO-E zones), so the result is exact down to the sample.
Pass tz to switch the timezone interpretation: 0/madrid (default, DST-aware), 1/cet (UTC+1 fixed — 8760 hourly buckets/year), or 2/utc. See /docs/concepts for why this matters around the spring/autumn DST transitions.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| tech | 1-11 | string | 1 (solar_pv) | Tech code or name (see table below). Codes 8-11 are virtual aggregates (total / renewable / thermal / fossil). |
| start | date | — | Start. Defaults: omit end for today (Madrid, with a small overnight cutoff), omit start for 30 days before end. |
| end | date | — | End. Omit for today. |
| agg | 0-7 | string | 2 (daily) | Aggregation is controlled by agg: 0=native, 5min/10min/15min, 1=hourly, 2=daily (default), 3=monthly, 4=quarterly, 5=semiannual, 6=annual, 7=total. |
| headers | 0 | 1 | 0 | Set 1 to include header row. |
| noDate | 0 | 1 | 0 | Set 1 to omit the period column. |
| tz | 0 | 1 | 2 | "madrid" | Madrid / CET / UTC. |
| unit | "MW" | "MWh" | "MW" | Output unit. "MW" returns the average power in each bucket (default, historical behaviour). "MWh" returns the total energy delivered in each bucket using each metric's native sampling interval. |
Valid values for tech
| Code | English alias | Description |
|---|---|---|
| 1 | solar_pv, solar, pv, fotovoltaica | Solar photovoltaic only (ESIOS 1295). For combined PV + thermosolar use ED.RANGE on gen_solar_pv and gen_solar_thermal separately. |
| 2 | wind, eolica | Onshore wind (ESIOS 551). |
| 3 | nuclear | Nuclear — Almaraz, Ascó, Vandellós, Cofrentes, Trillo (ESIOS 549). |
| 4 | hydro, hidraulica | Reservoir + run-of-river hydro (ESIOS 546). Excludes pumped storage. |
| 5 | combined_cycle, ccgt, gas | Combined-cycle gas (ESIOS 550). |
| 6 | coal, carbon | Coal-fired thermal (ESIOS 547). Largely retired since 2020. |
| 7 | solar_thermal, termosolar, thermosolar, csp | Concentrated solar thermal (ESIOS 1294). |
| 8 | total, all | All techs combined — solar_pv + solar_thermal + wind + nuclear + hydro + ccgt + coal + cogeneration + biomass + fuel_gas + pumped_storage (+ ENTSO-E catch-alls in non-ES zones). Excludes gen_exchanges and gen_pumped_consumption. Matches REE published peninsular generation within ~1-2%. Maps to gen_total. |
| 9 | renewable, renovable | Renewable techs only — solar_pv + solar_thermal + wind + hydro + biomass + geothermal + other_renewable. Pumped-hydro generation excluded to avoid double-counting the underlying energy. Maps to gen_renewable. |
| 10 | thermal, termica | Thermal techs — nuclear + ccgt + coal + oil + cogeneration + fuel_gas. Includes nuclear (thermal but non-fossil) and CHP (cogeneration). Maps to gen_thermal. |
| 11 | fossil, fosil | Fossil-fuel techs only — ccgt + coal + oil + cogeneration + fuel_gas. Excludes nuclear by design. Useful for emissions analysis. Maps to gen_fossil. |
| biomass | biomasa | Biomass + biogas. ENTSO-E sourced; mostly non-ES zones. |
| oil | — | Oil-fired generation. ENTSO-E sourced. |
| geothermal | — | Geothermal. ENTSO-E sourced. |
| other_renewable | — | Other renewables (small hydro, etc.). ENTSO-E sourced. |
| waste | — | Waste-to-energy. ENTSO-E sourced. |
| other | — | Other / unclassified generation. ENTSO-E sourced. |
| exchanges | interchange | Net international interchanges (ESIOS 553). Positive = import to Spain. |
The add-in accepts either the canonical Spanish code or the English alias — both are equivalent.
Returns
Spill array — [period, value] rows. Value unit depends on unit (MW or MWh).
Examples
=ED.GEN.RANGE(1, "2025-01-01",, 3)— Solar PV monthly average power (MW)=ED.GEN.RANGE(1, "2025-01-01",, 3, , , , "MWh")— Solar PV monthly energy delivered (MWh) — what most reports show=ED.GEN.RANGE(7, "2025-01-01",, 6, , , , "MWh")— Solar thermal annual MWh=ED.GEN.RANGE(2, "2025-07-01", "2025-07-01", "5min")— Wind 5-min average power for one day (~288 rows in MW)=ED.GEN.RANGE(3, "2020-01-01",, 6, 1, , , "MWh")— Nuclear annual MWh with header row=ED.GEN.RANGE(8, "2025-01-01", "2025-12-31", 6, , , , "MWh")— Total generation 2025 (MWh) — code 8 = all techs combined=ED.GEN.RANGE(9, "2025-01-01",, 3, , , , "MWh")— Renewable monthly (MWh) — code 9 = solar+wind+hydro+biomass+…=ED.GEN.RANGE("fossil", "2025-01-01", "2025-12-31", 6, , , , "MWh")— Fossil annual (MWh) for emissions analysis — code 11 / "fossil"=ED.RANGE("gen_biomass", "2025-01-01",, 3, "FR", 1, , , , "MWh")— For ENTSO-E-only techs use ED.RANGE with the metric name + unit="MWh".Notes
- MWh conversion only applies to MW-stored metrics. Calling it on a price (EUR/MWh) or already-MWh metric (e.g.
intraday_s1_energy) returns a 400 error. - Aggregation cost: AVG and SUM cost the same in SQL, so unit="MWh" doesn't slow down the query. Conversion happens at the database — no client-side multiplication needed.
- For the cross-tech total (e.g. "how much did Spain generate?") use
ED.RANGEwith the virtual aggregatesgen_total,gen_renewable,gen_thermal,gen_fossilinstead of summing tech-by-tech.