Prime minister Pedro Sanchez’s active pursuit of green energy agenda has meant the country was far better prepared for the current crisis

The move to green energy was already under way but the Russian invasion was certainly an accelerator. Suddenly, EU countries had to get away from a dependence on Russian energy supplies, with some switching to liquefied natural gas, sticking to the fossil fuel route.

Spain went down a different route and put the foot down on green energy, investing billions and offering support schemes for wind and solar.

Renewable power generation has doubled since the turn of the decade and the country produced 75pc of its electricity from low-carbon sources last year.

Solar capacity has almost tripled, while onshore wind has also grown exponentially. The boom in renewable energy in Spain is now being viewed with great interest by other European countries.

The transition has not been without its dark moments – quite literally. The Iberian Peninsula’s worst electricity outage in decades was blamed on the grid not being able to handle the green energy mix, although this was subsequently discounted.

However, the Middle East oil crisis has presented Spanish prime minister Pedro Sanchez with an opportunity to show how investing in renewable energy has helped lower the impact on households of energy price increases.

The steadfast focus means there is a continual pipeline of developments

Sanchez has championed renewables as he summarises his government’s approach as “green, baby, green” in a deliberate counterpoint to fossil-fuel obsessed US president Donald Trump’s slogan of “dig, baby, dig” slogan.

Ironically, Trump’s war is proving Sanchez is right as Spain was better prepared for the current crisis. Renewable sources currently make up 56pc of electricity generated in the mainland system.

By 2030, the Spanish government wants renewables to contribute 81pc of electricity, so there’s still a long way to go. Meeting the target will require the addition of more than 50GW of new renewable capacity over the next four years. The steadfast focus means there is a continual pipeline of developments. Fifty renewable projects entered the environmental approval process in a three-week period earlier this year.

The striking aspect of the handling of the oil crisis in this country is the absence of a discussion around solutions to our dependence on fossil fuels. The trite argument will be put forward that Spain has an abundance of a commodity that we have in short supply – the sun.

However, we do have plenty of wind and wave energy – but are bogged down in bureaucratic rows over plug-in solar panels for apartments.

Aside from the climate action value, the wars in Ukraine and Iran serve as wake-up calls to learn from countries like Spain and put a proper emphasis on generating our own cheaper, cleaner and greener energy.