{"id":1697,"date":"2025-09-26T16:51:47","date_gmt":"2025-09-26T14:51:47","guid":{"rendered":"https:\/\/demand.nl\/?post_type=knowledgebase&#038;p=1697"},"modified":"2025-09-26T16:51:47","modified_gmt":"2025-09-26T14:51:47","slug":"telemetry-forecasting-for-energy-trading","status":"publish","type":"knowledgebase","link":"https:\/\/demand.nl\/en\/wiki\/mlops\/mlops-case\/telemetry-forecasting-for-energy-trading\/","title":{"rendered":"Telemetry Forecasting for Energy Trading"},"content":{"rendered":"<figure class=\"wp-block-image size-thumbnail\"><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-7-150x150.png\" alt=\"\" class=\"wp-image-1706\" \/><\/figure>\n\n\n\n<p><strong>Problem Definition<\/strong><\/p>\n\n\n\n<p>Energy trading requires precise forecasting of power consumption to manage supply-demand imbalances, optimize trading decisions, and mitigate price volatility. Renewable energy sources, while sustainable, introduce unpredictability due to their dependency on weather conditions. As a result, Pure Energie requires short-term forecasts of the total energy consumption of all customers. This ensures efficient electricity trading by enabling precise buying and selling decisions.<\/p>\n\n\n\n<p><strong>Goal<\/strong><\/p>\n\n\n\n<p>The goal of this project is to design and implement a <strong>machine learning pipeline <\/strong>that accurately forecasts power consumption and production for Pure Energie customers 1 to 48 hours into the future. By integrating weather data from the KNMI and applying modern MLOps practices, the pipeline enables better decision-making for energy trading, helping Pure Energie optimize electricity purchases and sales.<\/p>\n\n\n\n<p><strong>Data Ingestion Pipeline<\/strong><\/p>\n\n\n\n<p>In our pipeline, we begin by downloading .tar files from the KNMI platform, which contain weather forecast data in .grib format. After extracting these files, we retain only the first-hour forecast entries for training. The .grib files are stored in MinIO for efficient object storage. From there, we retrieve the data, transform it into a usable tabular format, and store key variables in InfluxDB to enable high-performance time-series analysis. This processed data serves as the input for our prediction models. Since we do not have continuous access to allocation (consumption) data, model training is handled in a separate pipeline and must be manually triggered whenever new allocation data becomes available.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"422\" src=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1024x422.png\" alt=\"\" class=\"wp-image-1698\" srcset=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1024x422.png 1024w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-300x124.png 300w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-768x317.png 768w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1536x633.png 1536w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-18x7.png 18w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image.png 1861w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Whenever new weather data comes in, we make predictions for energy usage for the next 60 hours:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"505\" src=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1-1024x505.png\" alt=\"\" class=\"wp-image-1699\" srcset=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1-1024x505.png 1024w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1-300x148.png 300w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1-768x378.png 768w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1-1536x757.png 1536w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1-18x9.png 18w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-1.png 1861w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Data Preparation<\/strong><\/p>\n\n\n\n<p>Since we download approximately 1GB of weather forecast data every hour, it is crucial to identify and extract only the most relevant subsets to keep the pipeline efficient and manageable. Through targeted data preprocessing we minimize unnecessary processing, reduce storage overhead, and improve the overall accuracy and performance of the pipeline by eliminating noise and potential inconsistencies early in the workflow.<\/p>\n\n\n\n<p><strong>Data Structure<\/strong><\/p>\n\n\n\n<p>Because KNMI relies on technology that is around 20 years old, the main challenges lie in the data processing. They use GRIB files, where the data is represented as a map divided into a grid. Each grid cell contains approximately 50 different variables, measured at various heights and with different parameters.<br>Because we only care about the grid cells inside the Netherlands, we developed a custom conversion from coordinates to Netherlands\u2019 postal codes to be able to predict better the users\u2019 future consumes of energy.<\/p>\n\n\n\n<figure class=\"wp-block-image size-medium\"><img loading=\"lazy\" decoding=\"async\" width=\"291\" height=\"300\" src=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-2-291x300.png\" alt=\"\" class=\"wp-image-1700\" srcset=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-2-291x300.png 291w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-2-993x1024.png 993w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-2-768x792.png 768w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-2-12x12.png 12w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-2.png 1104w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/figure>\n\n\n\n<p><strong>Model Training Pipeline<\/strong><\/p>\n\n\n\n<p>When the actual allocation data becomes available, we manually trigger the model training pipeline to update the model using the latest and most accurate information. While this process is expected to be automated in the future, we currently lack direct access to the allocation data. As a result, the data must be manually uploaded and inserted into the database each time it is provided to us, adding an extra manual step before retraining can take place.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"554\" src=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-3-1024x554.png\" alt=\"\" class=\"wp-image-1701\" srcset=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-3-1024x554.png 1024w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-3-300x162.png 300w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-3-768x416.png 768w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-3-1536x831.png 1536w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-3-18x10.png 18w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-3.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Conclusion<\/strong><br>We successfully implemented a new pipeline that is easier to scale and better to monitor. While the quality of the model is naturally limited by the available KNMI data, the primary achievement of this project lies in establishing a robust and future-proof pipeline. This foundation ensures that as more data becomes available, the system can grow and improve efficiently.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"117\" src=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-6-1024x117.png\" alt=\"\" class=\"wp-image-1704\" srcset=\"https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-6-1024x117.png 1024w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-6-300x34.png 300w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-6-768x88.png 768w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-6-1536x175.png 1536w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-6-18x2.png 18w, https:\/\/demand.nl\/wp-content\/uploads\/2025\/09\/image-6.png 1900w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>This project has been executed in the context of the Master of Software Engineering &#8211; Saxion Hogeschool<\/strong><\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Problem Definition Energy trading requires precise forecasting of power consumption to manage supply-demand imbalances, optimize trading decisions, and mitigate price volatility. Renewable energy sources, while sustainable, introduce unpredictability due to their dependency on weather conditions. As a result, Pure Energie requires short-term forecasts of the total energy consumption of all customers. This ensures efficient electricity [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","knowledgebase_cat":[112],"class_list":["post-1697","knowledgebase","type-knowledgebase","status-publish","hentry","knowledgebase_cat-mlops-case"],"_links":{"self":[{"href":"https:\/\/demand.nl\/en\/wp-json\/wp\/v2\/knowledgebase\/1697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demand.nl\/en\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"https:\/\/demand.nl\/en\/wp-json\/wp\/v2\/types\/knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/demand.nl\/en\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/demand.nl\/en\/wp-json\/wp\/v2\/comments?post=1697"}],"version-history":[{"count":2,"href":"https:\/\/demand.nl\/en\/wp-json\/wp\/v2\/knowledgebase\/1697\/revisions"}],"predecessor-version":[{"id":1707,"href":"https:\/\/demand.nl\/en\/wp-json\/wp\/v2\/knowledgebase\/1697\/revisions\/1707"}],"wp:attachment":[{"href":"https:\/\/demand.nl\/en\/wp-json\/wp\/v2\/media?parent=1697"}],"wp:term":[{"taxonomy":"knowledgebase_cat","embeddable":true,"href":"https:\/\/demand.nl\/en\/wp-json\/wp\/v2\/knowledgebase_cat?post=1697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}