ED.UNIT
Generation per Spanish production unit — average power (MW) or total energy (MWh).
Signature
ED.UNIT(up, [date], [hour], [unit])Description
Actual generation for a single production unit (Unidad de Programación) reporting under ENTSO-E A73. ~300 plants in Spain, mostly conventional + large renewables. Use ED.UPS() to discover available unit codes (e.g. ALZ1 = Almaraz I).
Native cadence is 15-min. For the full Spanish UP registry (8000+ entries including small renewables and retailers, but without MW data) see ED.UP.SEARCH.
**Unit (unit parameter):** by default returns the mean power in MW over the requested window (hour or day), weighted by how long each published value was in force. Pass unit="MWh" to get the energy delivered instead — the integral of that same curve over the window.
**How the 15-min data is read (important).** ENTSO-E publishes A73 with curveType A03 — run-length encoded. A position missing from the document means *"the same value as the previous point"*, not zero and not "no data": a plant sitting at 985 MW all day may publish two points, not 96. EnergyData stores the document exactly as published and expands it at read time — every point is weighted by how long it was in force. Averaging the stored points as if they were equal samples over-reports by up to +777 % on a CCGT and by roughly +100 % across gas and solar as a whole; if you pull per-plant data from another provider, check which of the two you are getting.
**coverage_pct.** The REST responses carry a coverage_pct (0-1): the share of the requested period actually backed by published data. A value is carried forward only to the end of its own UTC day's publication — never across midnight, never backwards, never past the point where that day's data stops — so an ingest gap stays a gap with a low coverage_pct instead of turning into a plausible-looking number. Expect 1.000 for recent data; about 0.958 between 2025-05-31 and 2026-04-12 (hour 23 UTC was not collected) and about 0.240 before 2025-05-31 (an upstream resolution bug compressed each day into its first ~6 hours). Long-run averages spanning those periods are still affected — coverage_pct is how you spot it.
A window with no data returns #N/A, never 0: a zero here would read as "the plant produced nothing", which is a different — and false — statement.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| up* | string | — | ENTSO-E unit code (e.g. "ALZ1", "VAN2", "BES5"). Case-insensitive. |
| date | date | — | Date. Omit for the latest hour. |
| hour | 0-23 | — | Hour of day. Omit for the daily average / daily MWh total. |
| unit | "MW" | "MWh" | "MW" | Output unit. "MW" returns the duration-weighted mean power (default). "MWh" returns the energy delivered in the requested hour or day. Always available for unit_generation — no already-MWh edge case. |
* Required.
Returns
Number — generation in MW or MWh depending on unit.
Examples
=ED.UNIT("ALZ1")— Latest hour for Almaraz I (MW)=ED.UNIT("ALZ1", "2025-07-01", 14)— Almaraz I at hour 14 (MW)=ED.UNIT("VAN2", "2025-07-01")— Vandellós II daily average power (MW)=ED.UNIT("VAN2", "2025-07-01", , "MWh")— Vandellós II daily energy delivered (MWh)Notes
- The value is a duration-weighted mean, not the average of the stored points: ENTSO-E A73 is run-length encoded (curveType A03) and only publishes a point when the value changes.
- The REST endpoint (
/api/data/unit) returns acoverage_pctnext to the value. An hour or day with no published data answers 404, which Excel shows as#N/A— never 0. - Calendar-day edge (
houromitted): a value still in force across civil midnight is credited entirely to the day it started in, about 1 % of intervals. Immaterial for plants that run around the clock, visible for units that switch off overnight; ask for a specifichourif you need the boundary exact. dateandhourare Spanish civil time (Europe/Madrid), DST included: a 23-hour or 25-hour day is 23 or 25 hours here too.