Open-source models for holistic building energy system design at scale (Completed)
Buildings and cities are becoming increasingly integrated into the energy supply system, creating a need for transparent, trustworthy, and holistic information for potential prosumers. This project is building the foundation for easy-to-access and automate building energy models to support distributed decision making and the energy transition.

Background
The need to improve energy efficiency and manage supply in buildings and cities is a core aspect of many climate change mitigation and sustainability scenarios. Demand for prosumer technologies, such as solar photovoltaics (PV), batteries, and electric vehicles (EV), is growing rapidly. At the same time, electrified heating already places a large demand on the electricity grid, therefore guiding a diverse set of citizens towards the best technical, economic, and social solution for the energy system is a challenge.
There is a long history of research in urban building energy models (UBEM) and several closed- and open-source software packages have been developed. These tools are typically used by researchers, city planners and policymakers, whereas the ones actually taking decisions – the building owners – typically get their information through commercial channels where biases and information asymmetry can create sub-optimal outcomes.
Solar maps are a good example of a public facing information source, where users can see the potential of their roofs for solar PV generation without needing to go through a salesperson. The utility of solar maps was boosted by our previous project , where the tools provide an analysis and specific recommendation with the same detail as a solar installer. Advances in data collection, geographic information systems, and machine learning make this possible, and this project aims to bring this same functionality to all aspects of building energy systems in support of prosumers contributing to the energy transition.
Aim and objectives
This project aims to democratize energy system design and empower building owners with trustworthy information for holistic analysis of sustainable technologies.
- Identify the minimum viable dataset required to adopt and apply the proposed models
- Build an integrated prosumer energy systems model which can automatically design and recommend a holistic solution considering demand and supply
- Create an open-source code base that can be easily transferred to any municipality in Sweden
Project partners
rebase.energy, AIT Austrian Institute of Technology, Karlstads Energi, Karlstad Kommun
Funding is provided by the Swedish Energy Agency’s E2B2 program (project number P2022-00903).
Timeframe: January 2023 – December 2024 (Extended to June 2025)
Outcomes
This project was an ambitious attempt to combine urban building energy models, data driven models, private datasets, and public datasets and turn them into a scalable digital energy advisor for Swedish buildings. While the potential for such a tool exists, shortcomings of UBEMs and barriers to open data were discovered that makes future development more challenging than previously thought. UBEMs are good at simulating large building stocks with low error in aggregate, but providing individualized energy advice without user contact or input to the model results in unacceptably high variance in accuracy (+/- 30%) relative to the effort needed to build them.
The need to anonymize meter data from villas due to GDPR creates challenges for model development and validation. A novel approach to labeled the meter data was developed using the energy performance certificate dataset and unsupervised learning techniques. The resulting models did not improve over UBEM models in the literature, however direct comparisons were limited due to the scope of the model developed here applying to all energy demands, not just space heating. From a practical standpoint, the data driven models are easier to deploy at scale, and require less computation time, once trained, therefore even if errors are not reduced with this method, they can be a more viable alternative to UBEMs.
In contrast, energy supply models are relatively easy to simulate as there are several validated models for technologies like solar PV, batteries, and heat pumps available. However, the results here show that a modeling pipeline is needed to provide continuously updated analysis due to rapidly changing market conditions. Electricity prices have become volatile and a cannibalization of PV value is beginning to emerge even though Sweden receives less than 3% of its electricity from solar. The new model presented here using EnergyDataModel and enflow frameworks in Python, can help automate and standardized the analysis. And since it is published open-source, its also fully transparent.
Two open-source frameworks were launched as part of this project, targeting energy data scientists and modelers as the target user group. The first is called EnergyDataModel , and it provides a Python-based data model that helps to write more modular and readable code. The second is called enerflow , and is a Python framework inspired by OpenAI’s Gymnasium that helps in writing modular and reproducible energy models that solves sequential decision problems. Our hope is that the developments of this project are the beginning of a new era in collaboration and sharing of energy systems models and data to accelerate our knowledge of sustainable energy in buildings and cities.
Publications
Scientific Articles
Song, Y., Sommerfeldt, N. Data driven models for hourly electricity load profiles in Swedish villas. Submitted in Q4 2025, full details added once published.
Sommerfeldt, N., Riberi, M., Haglund, S. Optimal prosumer battery sizing and operations under price volatility. Submitted in Q4 2025, full details added once published.
Sommerfeldt, N., Höjer, M. (2024) The Potential and Limits of Digital Energy Advisors. 10th International Conference on ICT for Sustainability (ICT4S), 24-28 June 2024, Stockholm, Sweden. 10.1109/ICT4S64576.2024.00042
Master Thesis
Lundholm, S. (2023) Techno-economic analysis of solar and battery systems. KTH M.Sc. Thesis.
Open-Source libraries
EnergyData Model ( www.energydatamodel.org ), GitHub Repository
enflow ( www.enflow.org ), GitHub Repository
Data Protection
This project is guided by the EU General Data Protection Regulation (GDPR) .
Public and private data associated with individual households will be used during the course of this project, and includes;
- The full database of energy performance certificates (energideklaration in Swedish), as of July 2023, acquired from Boverket. This data can be traced back to individual households, but is also part of the public domain .
- Anonymized historical electricity and heat meter data, with hourly time resolution, from hundreds of residential buildings within Karlstad Energi’s customer base. This data is not associated with and cannot be traced back to individual households.
- 3D building geometry from Karlstads kommun, which is already in the public domain .
This data will be used in novel simulation methods, as either inputs or to validate outputs, used to predict the hourly energy demand of any real residential building at a city-wide scale. The demand profiles generated during the project will be informed by the original data listed above, but will only be representative of what a typical demand profile can look like. At no point will any original data from any of the sources be published publicly or used for purposes outside the scope of the project.
The original data used by KTH and AIT researchers during the duration of the project will be deleted from their respective computers/servers within six months of the project’s completion (June 2025).
Individuals may voluntarily provide permission to associate their meter data with their household. It is their right to, at any time during the project, to withdraw their consent and have their data removed from the project dataset.
Contact details for the project responsible, Nelson Sommerfeldt, can be found at the bottom of the page. The KTH data protection officer can be contacted at dataskyddsombud@kth.se