Deploying AI-Driven Flexibility Models in Virtualized LV/MV Substations

Cuerva ran a distribution network where concentrators, low- and medium-voltage supervisors, and MV remote units each operated on their own protocol at different voltage levels, making congestion and overvoltage in the low-voltage grid detectable only after the fact. Using Barbara's platform, the company consolidated a secondary substation onto a single node and ran Gridfy's AI forecasting models directly within it, giving operators a six-hour forward view of the grid with no cloud in the loop.
Customer:
Industry:
Region:
Europe
Ecosystem:
Gridfy
Technologies:
IEC-104
Modbus TCP/IP
SOAP
MQTT
InfluxDB
Grafana
scikit-learn
Container Application

Business Overview

Distribution System Operators (DSOs) are under mounting pressure from the electrification of the energy sector. Decentralized renewable installations are proliferating, while new players such as electric vehicles, heat pumps, and energy storage systems are connecting to the low voltage grid. To adapt, DSOs have had to move from managing unidirectional energy flows to overseeing complex bidirectional flows. This shift demands a proactive approach to grid stability and supply quality, supported by both real-time operations and strategic planning.

Cuerva, an energy company covering the entire value chain from generation to distribution and retail, set out to address this shift by digitalizing its distribution network. The obstacle was the network itself. Concentrators, advanced low and medium voltage supervisors (SABT and SAMT), and MV remote units from different manufacturers each spoke their own protocol at a different voltage level, with no single point at which their data converged. Without an integrated view, every new application or algorithm had to be developed device by device. Meanwhile, the congestion and overvoltage events caused by bidirectional flows in the low voltage grid could only be identified after they had already occurred.

Working with Gridfy, the network digitalization brand owned by the group, Cuerva chose Barbara as the edge infrastructure for the project. The aim was to unify the secondary substation at a single point and run Gridfy's AI energy forecasting models within the substation itself, in real time and without relying on the cloud.

Challenges

Consolidating a secondary substation onto a single node and running AI forecasting within it presented four challenges:

  1. Multi-vendor devices with incompatible protocols: Equipment across the network came from different manufacturers, each using its own communication protocol. Integrating all of it into a single edge platform was essential to gaining unified visibility across every point of the secondary substation. Without this integration, the development of applications and algorithms remained tied to individual devices.
  2. No standardized data model in the edge node: With as many data formats as device families, grid data could not be represented reliably, and integrations with other systems had to be reworked case by case. Effective data handling and analysis therefore depended on establishing a common data model within the node.
  3. No forward view of the low voltage grid: Predicting demand, generation, and their impact on the grid required artificial intelligence and machine learning techniques that Cuerva did not yet have in operation. As a result, the company could not anticipate the potential congestion and overvoltage events it needed to prevent.
  4. AI models that could not rely on the cloud: The algorithms needed to be optimized for real-time execution on the edge node, with no cloud interactions in the loop. This raised a critical question: whether a node installed inside a transformation centre had sufficient computing capacity to process the data and make autonomous decisions locally.

Solution

Using Barbara Core and Barbara Panel, Cuerva deployed edge nodes across the transformation centres in its distribution network. Barbara Core ran on the node installed in each substation, providing the secure runtime for the containerized microservices, or workloads, that formed the solution and connecting them to the surrounding OT equipment. Its management agent maintained permanent communication between every node and Barbara Panel. From this single environment, Cuerva managed the distributed fleet by deploying and updating workloads and AI models, overseeing their lifecycle, monitoring the communication status of each node, and reconfiguring them remotely without sending staff to the substation. Many of the workloads in the architecture came from Barbara Marketplace, where they were available off the shelf. The team could therefore assemble the deployment from certified applications instead of packaging each one independently. Rigorous testing confirmed that this type of node had enough computing capacity to process substation data, sustain the required performance, and make autonomous decisions directly at the edge.

Gridfy's AI Energy Forecasting Model ran on top of this infrastructure, predicting the electrical behaviour of every user connected to the secondary substation hosting the node. The model combined three algorithms. An active and reactive power prediction model focused on the consumer side and anticipated potential congestion and overvoltage events in the low voltage grid. A flexibility asset assessment model evaluated the flexibility assets available within Cuerva's grid and created accurate models of them. A flexibility needs determination model then established the flexibility requirements of the system as a whole.

Reference architecture for Cuerva

The following workloads were deployed on the edge node:

Data Acquisition

  • IEC 104, Modbus, and SOAP Connectors: Acquired data from the equipment installed in the transformation centre, including the advanced medium and low voltage supervisors (SAMT and SABT), transformer, and smart meter concentrators. Each node used the connector matching the protocol exposed by each device, allowing the same architecture to be applied across transformation centres of different ages and manufacturers.
  • Open-Meteo Connector: Supplied the forecasting algorithms with the required external weather variables, temperature and radiation, delivering them directly to the model rather than through the broker.

Data Distribution and Storage

  • MQTT Broker: Coordinated communication between the different elements of the deployment. Using the publish-subscribe model, applications shared data for storage, processing, and visualization.
  • MQTT to InfluxDB Ingester: A Barbara application that wrote information circulating through the broker to the time-series database, both on the node and in a second cloud instance.
  • InfluxDB: The time-series database on the node stored data obtained from field equipment alongside the results generated by the models. Both remained locally available to the algorithms and dashboards that consumed them.
  • Cloud InfluxDB: Provided a central copy of the data, giving Cuerva's teams database access to information from every substation without requiring them to connect to each node individually.

Forecasting and Visualization

  • Scikit-Learn Model Serving: Ran Gridfy's forecasting algorithms on the node as another workload, deployed and updated in the same way as the others. It completed the inference loop locally by reading field measurements from InfluxDB, calculating predictions within the substation, and writing the results back to the same database. Measurements and forecasts were therefore stored side by side on the node.
  • Grafana: Visualized the information stored on the node, combining historical data, a real-time representation of the grid, and a digital twin with a six-hour flexibility prediction.

Operators could consult these dashboards without travelling to the transformation centre. Barbara's built-in VPN service provided secure remote access to the web interfaces of the workloads running on the node. This kept the data inside the substation while allowing authorized staff to work from anywhere. Cuerva also evaluated retraining the flexibility algorithms on the node itself rather than in the cloud, using MLflow to upload the retrained algorithm automatically to the serving application.

Results

Consolidating the secondary substation onto a single node changed how Cuerva operated and planned its distribution network:

  1. A single point of visibility over the secondary substation: Integrating every device onto one node through its own data protocol removed the need to maintain a separate platform for each equipment family and reduced data integration costs. Replicating the data to a central database also enabled advanced analytics across substations, providing the insight required for data-driven grid operation decisions.
  2. Near real-time decision-making at the substation: With acquisition, storage, and prediction all running on the node, operations no longer depended on cloud interactions. This agility enabled swift responses to sudden changes in demand or generation.
  3. A six-hour forward view of the low voltage grid: The digital twin gave operators a six-hour flexibility prediction, turning congestion and overvoltage into events that could be anticipated and addressed before they compromised supply quality.
  4. Improvements in supply quality indicators: Real-time alarms and monitoring of the secondary substations allowed operators to address supply quality issues promptly, contributing to an improvement in SAIDI, the System Average Interruption Duration Index. Forecasting potential grid problems and correcting them proactively also contributed to an improvement in SAIFI, the System Average Interruption Frequency Index.

Testimonial

"Barbara offers a flexibility that you cannot get from other technology companies. Using their technology we have been able to develop applications for different uses ourselves, with easy rollout and modification. This means we can continue exploring new possibilities."

Alberto Sánchez, Managing Director at Gridfy

Conclusions

By running Gridfy's flexibility models as containerized workloads on Barbara's platform, Cuerva virtualized the LV/MV substation and turned it into a computing environment of its own, where data from every device converged on a common model and AI predictions were generated locally, in real time and without leaving the site. The company moved from reacting to grid events to anticipating them on an extensible infrastructure. Because every node was managed remotely and its applications operated independently, Cuerva could add new algorithms to the same substations as the needs of a bidirectional grid evolved.

The impact extended beyond the individual substation. Standardizing acquisition, storage, and forecasting on a single node made the architecture replicable across the transformation centres of the distribution network, with each new site joining an already centrally managed fleet. For a distributor facing both the electrification of demand and the growth of distributed generation, this combination of local intelligence and remote management established the foundation for a more advanced, decentralized, and intelligent energy management system.

About the Company

Cuerva is an energy company founded in Granada, Spain, in 1939, when it began supplying electricity to rural areas of the province through renewable hydraulic generation. More than 85 years later, it operates nine lines of business covering the entire energy value chain, from generation and distribution to retail and customer energy services. The company employs over 140 people and operates in three countries: Spain, Peru, and Panama.

Cuerva's distribution business is undergoing a wide-ranging digitalization process aimed at improving supply quality and offering greater value to end users. Control systems deployed across the network, from the substation to the end customer, provide minute-by-minute measurements and complete real-time visibility of the grid. This capability is developed through Gridfy, Cuerva's Madrid-based technology brand, which specializes in the digital transformation of electrical networks. As a strategic partner to utilities and energy operators, Gridfy provides end-to-end digitalization solutions built on data analytics and artificial intelligence to enhance grid operations, improve planning capabilities, and optimize maintenance processes.