SUNDAY June 16th this year was a Goldilocks sort of day across Germany, not too hot but not too cool, with bright sunshine and a reasonable offshore breeze. Just right for Germany’s solar panels and wind turbines to produce, at their peak, a record 60% of Germany’s electricity on a slow weekend. But France and Belgium also had lots of nuclear power that could not easily be cranked down. So for several hours, generating companies had to pay customers to take their surplus power.

Negative wholesale prices have become more common as European countries turn to renewables—particularly Germany, with its forced march away from nuclear power, known as the Energiewende. If at times Germany has too much of a good thing, at others it must suck power from nuclear plants across the border in France. And German ministers still worry about the risk of blackouts when the weather is cold, the sun does not shine and the wind does not blow.

Neighbours such as Poland and the Czech Republic complain that power surges from Germany are playing havoc with their grids. Across Europe a strange consequence of subsidised renewables is that some governments now want to pay power companies to maintain the capacity to produce electricity from fossil fuels to ensure that backup power is available. More perversely, Europe is burning more heavily polluting coal at the expense of cleaner and more flexible gas, because coal is cheap, the gas market is far from liquid and the carbon-emissions systems is broken.

Another oddity is that Germany pays some of the lowest wholesale prices for electricity in Europe, yet suffers from some of the highest retail prices. Consumers are burdened with all manner of network fees, taxes and ever-growing charges to subsidise renewable energy. And they support heavy users, exempt from some charges. Politicians argue over the mess ahead of the general election this month, but neither the Christian Democratic chancellor, Angela Merkel, nor her Social Democratic challenger, Peer Steinbrück, wants to roll back the Energiewende.

The real problem is that neither leader is thinking big enough. Energy policy is best addressed across Europe as a whole. Look across the continent at Spain: it too has abundant renewable power from sun and wind, so much so that subsidies are burning a large hole in its already worrying public finances. Unlike Germany, Spain cannot sell much of this bounty to others because of inadequate interconnectors to France. If the grids were linked up properly, in a large integrated energy market, then the peaks and troughs would be likely to even out. Rather than carpet grey Germany in solar panels, better to install them in sun-kissed Greece.

The benefit of cross-border co-operation was recognised long before the creation of the European Union: in the 1920s France and Italy started trading electricity with Switzerland so that surplus energy could be stored in Alpine reservoirs. But full integration is far off. Eastern Europe still has “energy islands”, especially the ex-Soviet Baltic states, vulnerable to blackmail from Russia. Lithuania, which currently holds the rotating presidency of EU ministerial meetings, pays much more than Germany for its natural gas, though the Russian border is just a short drive from Vilnius. Rarely does the much-abused slogan of “more Europe” make more sense, and solve more problems, than in energy matters. Done properly, an integrated energy market could favour the transition to renewable power, enhance security and promote cheaper energy. The wider the grid, the easier it would be to manage renewables and operate flexible gas plants to provide steady power. And if the grid was “smart”, consumers could more readily be given incentives to use electricity when power is cheap.

If Europe operated as a single energy zone it would also be harder for Russia to pick off individual countries. No wonder Vladimir Putin, Russia’s president, detests the liberalisation of Europe’s gas market, which forces giants like Gazprom to “unbundle”, open up their pipelines to competitors and submit to investigation by EU competition authorities. More liberalisation would, moreover, bring down prices. The European Commission thinks fully integrated gas and electricity markets could yield savings of up to €65 billion (about $86 billion) a year.

Yesterday’s dream

European leaders once thought that they were leading the way towards the era of low-carbon power. Now they worry more about the cost of energy and of being left behind by America’s cheap-shale-gas revolution. At a summit in May European leaders were horrified to hear that, between 2005 and 2012, according to the commission, gas prices for industry fell by 66% in America but rose 35% in Europe. This threatens Europe’s competitiveness, amid worries that energy-hungry European factories are decamping to America. Whereas America is forecast to become a net exporter of energy in the next few decades, Europe’s dependence on foreigners will only grow.

Yet European leaders only pay lip-service to developing the energy market. It would mean relying on others to provide energy when it is needed, and turning a blind eye to how they produce it. Some of this already happens. The difficulty is that, despite the benefits, a deeper market would create winners and losers, and require expensive cross-border infrastructure. Perhaps most intractable is the growing web of national incentives: power companies may trade even more energy in wholesale markets, but taxpayers do not want to subsidise foreigners.

As with so much else, a lot will depend on Germany. It is Europe’s biggest energy consumer and the biggest producer of renewable energy. Its grids would be at the heart of any upgraded pan-European network. Mrs Merkel and her successors will decide where and how the gas and electricity in Europe flows.

Economist.com/blogs/charlemagne