About

Portugal electricity tracker

This website visualizes Portugal's electricity consumption patterns, taking into account both domestic generation and international exchanges.

Why This Exists

The Portuguese electrical grid operator, REN, makes some Portuguese electricity data available through the REN Data Hub. This website aims to provide some functionality that the REN Data Hub does not provide.

  1. Power discriminated by Origin and Source.

The REN Data Hub shows only (1) the Portuguese generation mix by source; and (2) imported electricity in an aggregated fashion without discrimination by source, which does not tell users the likely source mix of the imported power.

Portugal Electricity Mix aims to fix this by estimating the contribution by both Origin and Source, allowing users to know the true consumption mix of electricity.

This became increasingly relevant in recent years as Portugal’s reliance on imported electricity grew, with imports sometimes representing more than 40% of consumed electricity. This is furthermore of interest in order to analyze the carbon intensity of domestic consumption when accounting for imports.

  1. Ability to select custom/complex time intervals. Currently, the REN Data Hub only allows the selection of specific days or specific months for which to inspect the mix data. It does not allow the selection of other custom intervals (arbitrary start and end), or complex intervals (constituted by several disjoint simple intervals).

Selecting these can be useful to inspect how the electricity mix varies in specific contexts, like Winter or Summer (or potentially across multiple years), at nighttime (e.g. 8pm-6am), Winter nighttime, etc.

Complex intervals are expressed as calendar patterns: pick some years (not necessarily consecutive) and keep only some months, weekdays and hours of the day (Lisbon time), e.g. winter nights (December–February, 20:00–06:00) in 2016–2017 and 2022–2025.

This website does not aim to replicate all the functionality that REN Data Hub or even others like Electricity Maps already provide. Rather, it is meant to provide some of the functionality they do not provide, such as discriminated imports and custom/complex intervals.

This is a personal project made in order to obtain some perspectives that are important in order to evaluate the current electrical system policy in Portugal.

Methodology

Data Source

The data is sourced from ENTSO-E, the European Network of Transmission System Operators for Electricity. This website has access to data from January 2015, roughly the start of the ENTSO-E Transparency Platform records used here, up to the most recent data made available by ENTSO-E.

Approximations

In order to tackle this problem, some approximations were made:

  1. The generated power is assumed to be distributed homogeneously throughout the grid, per country. For example: taking Spain in isolation, we make the assumption that the mix of electricity provided in any location in the country simply corresponds to the overall mix for the country.

    a. Corollary: The source mix of a cross-border export is the same as the mix of electricity in the grid of the exporting country. This assumption follows directly from the assumption above.

    b. This assumption greatly simplifies the problem, which would otherwise require taking the topology of the grid into account (and data that is likely not available). Such a project would be of a whole other scope.

  1. Cross-border flows are assumed to be acyclic. If there is, for a given border (e.g. Spain-France), at any point in time, non-zero flows in both directions, then the exports are assumed not to interfere with the imports. I.e. if Spain is both importing and exporting from/to France at a given time, then the mix of the France Spain flow is assumed to have the same distribution as France’s generation. As such, we are discarding any “loop” effects, of flows that enter a country and go back to the country of origin due to subpar transmission infrastructure in that country. This is the case, for example, with Germany, where often electricity is transmitted between the southern and northern regions via a detour through France/Belgium/Netherlands, due to the relatively weak north-south domestic transmission axis. a. This is in general a reasonable approximation to do in the case of the Portugal-Spain flows due to the good domestic transmission networks of both countries. In fact, for each border, flows in only one of the directions were observed for the most of the hourly timestamps on record (as of June 2026). For the PT-ES and ES-FR data, simultaneous flows in both directions were observed in only 3.4% and 2.9% of the hourly timestamps, respectively. b. However, Spain Portugal flows will consider a recalculated Spanish grid mix that takes the FranceSpain flows into account.

  2. Only the contributions of Portugal’s, Spain’s and France’s generation were considered. a. Portugal’s electricity imports are sizeable. In 2023, around 22.6% of the electricity consumed was imported. However, in this case, the French contribution represented only about 0.7% of consumption. Even at the highest-import hour in the available historical data as of June 2026, when imports represented about 71% of consumption, the French contribution was about 3%. As such, the approximation should have a small impact.

  3. Resampling to hourly granularity. The ENTSO-E generation and cross-border-flow series used by the model can arrive with different native resolutions depending on country, document type, and historical period. The relevant series are resampled to hourly values. When 15-minute data is present, each hour is represented by the mean of the four 15-minute blocks.

Model and Calculation

From the ENTSO-E API it is possible to request data and process it into the following variables:

  • : the generation matrix for country . Rows represent the time and columns represent the source types.
  • : a vector representing the (non-netted) cross-border total flows from country to country .

We retrieve the generation matrices for Portugal, Spain, and France, plus Portugal-Spain and Spain-France flow vectors in both directions.

For each country:

  1. The relative weight of each source at each timestamp is calculated as:
  1. Exports per source are calculated by applying those relative weights to total exports. For example, exports from France to Spain are:
  1. Imports per source are calculated similarly, using the source mix of the exporting country.

  2. The effective source mix on the grid is calculated by subtracting exports (per source and time) from the country’s generation and then adding imports.

We start by calculating the above for the Spain-France pair, in order to calculate the intermediary grid mix for Spain, (notice the prime symbol ’). We calculate the interactions for Portugal-Spain using that intermediary Spanish grid mix. These two steps are represented in the expressions below:

Where is the resulting Portuguese electricity consumption matrix, indexed by time and source.

Combining those two steps gives:

The full expression can be used to plot Portugal’s aggregated consumption mix after accounting for exports and imports. The separate terms can also be used to show the Portuguese, Spanish, and French contributions separately.

Storage Charging

Part of the electricity available on the Portuguese grid is not consumed but stored: it pumps water uphill or charges batteries, and comes back later as generation. Counting it as consumption would count that energy twice, once when it is stored and again when it is returned.

ENTSO-E reports this storage charging load separately. Let be the total storage charging load in Portugal at time . Charging draws from the grid mix at that hour, so it is removed proportionally from every source, in the same way as exports:

The tracker’s Consumption is this final consumption. Storage charging is shown separately. The time chart draws each source before this removal (, what was produced or imported) and storage charging below zero, so the height above zero minus the depth below zero is final consumption. The chart options (⋮) set two things separately. Above zero, the charging can either stay inside each source, or be drawn as a pale band on top of final consumption, split by the source it came from (computed hour by hour). Below zero, storage can be shown or hidden. With charging inside the sources and nothing below zero, the chart matches REN’s: storage is the gap between a Consumption line and the top. The source table lists storage charging below the sources. The donut stays at 100% of final consumption; the bar above it shows how the total split between consumption and storage over the selected period. In the Generation view, storage charging is drawn below zero unless hidden.

When stored energy returns to the grid, it appears as generation (e.g. “Hydro Pumped Storage”) and is attributed like any other source. The tracker does not trace which source originally charged the storage.

This model provides an average consumption-based attribution using proportional sharing. It does not estimate which generators were dispatched because of cross-border trade or the marginal effect of imports on generation, prices or emissions.

Features

  1. Time interval selection
  • Selection of arbitrary time intervals. The tracker supports fixed ranges such as one day, seven days, thirty days, one year, all available data, and custom start/end date ranges.
  • Selection of complex intervals. The Complex range selects years and keeps only the selected months, weekdays and hours of the day in Lisbon time, e.g. winter behaviour across several years, or nighttime behaviour 20:00–06:00. Averages and energy then cover only the matching hours. Periods with no matching hours are left out of the charts, and a vertical line marks each place where time is skipped.
  1. Visualization modes
  • By Source categorization:
    • Detailed. Shows every source as reported by ENTSO-E.
    • Simplified. Aggregates variants of a source type. E.g. hydro-based sources are aggregated into “Hydro”, coal sources are aggregated into “Coal”, etc.
    • Dispatchable/Non-dispatchable. Groups sources according to whether they are generally controllable on demand. Wind and solar are grouped as non-dispatchable; the remaining reported sources are grouped as dispatchable.
    • Fossil/Nuclear/Hydro/VRE. Groups sources into fossil generation, nuclear generation, hydro generation, variable renewable energy (VRE: wind and solar), and other sources.
  • By Origin:
    • By Source. Shows the total Portuguese consumption mix grouped only by source, without separating the estimated country of origin.
    • By Origin/Source. Separates the mix first by country of origin (Portugal, Spain, France) and then by source within each origin.
    • By National Detail + Imports. Shows the estimated Portuguese contribution by source and aggregates the estimated Spanish and French contributions as imports. This is a simplified consumption-mix view, not the same as REN Data Hub’s generation-focused charts.
    • By Origin. Shows only the estimated country-of-origin contribution to Portuguese consumption, without source detail.

Notes

  • “Hydro Pumped Storage” is not only pumped water. For Portugal, ENTSO-E’s pumped-storage generation also includes natural inflow to those reservoirs, so it is larger than the energy that was pumped. The tracker keeps it under Hydro in grouped views.

  • Missing data handling. There are some timestamps for which ENTSO-E provides no data for some sources. After aligning the series to common timestamps, missing values are estimated with linear interpolation where possible.

Authors

Diogo Valada

Owner & Developer

LinkedIn

Acknowledgements

This website is based on a fork of the excellent OpenElectricity website developed for the Australian electricity system. The Tracker page for this website was implemented from scratch, taking design inspiration from the Vue-based tracker from the original Australian website.

Licensing and attribution

Data is sourced from the ENTSO-E Transparency Platform. Portions of the frontend are based on MIT-licensed OpenElectricity/OpenNEM code, with the Portugal tracker substantially reimplemented for this website. Original Portugal-specific content and implementation are © 2026 Diogo Valada, except for third-party components and upstream MIT-licensed portions. No endorsement by ENTSO-E or OpenElectricity is implied.