Spain is looking at storing electricity or increasing demand to solve electricity oversupply.
The patchwork plains of Castilla-La Mancha, in central Spain, were once known for their windmills.
But now it is wind turbines, their modern-day equivalent, which are much more visible on the region’s skyline.
The 28 vast turbines of the Sierra del Romeral windfarm, perched on hills not far from the historic city of Toledo, look out over this landscape.
Operated by Spanish firm Iberdrola, they are part of a trend that has accelerated Spain’s renewable energy output over the past half-decade, making the country a major presence in the industry.
Spain’s total wind generation capacity, its prime renewable source in recent years, has doubled since 2008. Solar energy capacity, meanwhile, has increased by a factor of eight over the same period.
This makes Spain the EU member state with the second-largest renewable energy infrastructure, after Sweden in first place.
Earlier this year, Spain's Socialist Workers' Party prime minister, Pedro Sánchez, described his country as "a driving force of the energy transition on a global scale".
The boom began soon after the arrival of a new government under Mr Sánchez in 2018, with the removal of regulatory obstacles, and the introduction of subsidies for renewable installation. The pandemic further accelerated the trend on a domestic level.
"The impact of Covid was very positive for our sector," says José Donoso, chief executive of UNEF, the Spanish Photovoltaic Association, which represents the solar panel sector. "People saved money, took time to think about what to do with it, and many of them decided that it was better invested on their roof than in their bank."
Meanwhile, the government introduced ambitious new targets, including covering 81% of Spain’s electricity needs with renewables by 2030.
However, behind this success story, there are concerns within the electricity industry caused by an imbalance between supply and demand with, at times, a surplus of electricity.
Even though the Spanish economy has bounced back strongly from the trauma of the Covid pandemic, and is growing faster than all of the bloc’s other big economies, electricity consumption has been dropping in recent years.
Last year, demand for electricity was even below that seen in the pandemic year 2020, and the lowest since 2003.
"What we saw until 2005 was that when GDP increased, demand for electricity increased more than GDP," says Miguel de la Torre Rodríguez, head of system development at Red Eléctrica (REE), the company that operates Spain's national grid.
More recently, he says, "we've seen that demand has increased less than GDP. What we're seeing is a decoupling of energy intensity from the economy".
There are several reasons for the recent drop in demand. They include the energy crisis triggered by Russia's invasion of Ukraine in 2022, which caused businesses and homes across Europe to cut back on usage.
Also, energy efficiency has improved and become more commonplace.
The increased usage of renewable energy has also contributed to the reduction in demand for electricity from the national grid.
Mr Rodríguez says that during daylight hours, when solar energy output is particularly strong, the supply-demand balance can be pushed out of kilter, having an impact on prices.
"Since the power system always has to have an equilibrium – demand has to equal generation – that has meant there has been excess generation during those hours," he says.
"That has driven prices down, especially during certain hours, when the prices have been zero or even negative."
While such low prices are welcome for consumers, they are potentially a problem when it comes to attracting investment to the industry.
"This can make it more difficult for investors to increase their investment in new electricity based on renewable energies," says Sara Pizzinato, a renewable energy expert at Greenpeace Spain.
"That can be a bottleneck for the energy transition."
Concerns about Spain having an excess of electricity have led to discussion of the need to accelerate the "electrification" of the economy, which involves moving it away from fossil fuels. The Sánchez government has set a target of making 34% of the economy reliant on electricity by 2030.
"This process is going slowly, and we need to accelerate it," says UNEF’s José Donoso.
"Electricity is the cheapest and most competitive way to produce clean energy.
"We need facilities that use electricity in place of fossil fuels."
Shifting to a total reliance on electricity is seen as unrealistic, as some important sectors like chemicals and metals will find the transition difficult.
However, Mr Donoso and others see plenty of scope for swifter electrification. For example, Spain is trailing many of its European neighbours when it comes to the installation of heat pumps in homes, and the use of electric cars, which only make up around 6% of vehicles on the road.
Ms Pizzinato agrees that electrification is crucial, but says there are other ways of tackling the supply-demand quandary, including phasing out the use of nuclear plants more quickly, and increasing energy storage capability.
She says: "We need to engage more people and more industries in demand-side management, to make sure the flexibility needed in the system is out there to make generation and demand match better during the day and during the night."
Transport grids aren't free, and excess electricity production is bad as it requires curtailment (wastage) which isn't free either to prevent damage to electric equipment (very expensive).
Besides, when renewables produce these excesses, this will often be the case in a very large area.