“No one expected me to win,” said the Labour MSP Daniel Johnson, as he settled down in one of his constituency’s signature coffee shops. “The odds were 20-1 at the start of the year.”

Johnson is the Labour politician who bucks the trend. He won his seat in May 2016, one year after Scotland’s Labour MPs were all but wiped out by the Scottish National Party. Not only that, but he snatched it from a Nat, Jim Eadie. So how did he do it?

“If there is one lesson my victory offers, it is Labour needs to be a little bit smarter in tying its message to different people,” he said. “We very carefully considered how to pitch the national Labour message. “

Johnson’s Edinburgh Southern constituency is one where streets are lined with sandstone Victorian villas, where shops sell artisan coffee and rye bread, and girls in private school kilts stop for ice-cream on the way home.

Nevertheless, the former local businessman managed to sell Labour’s flagship policy, a 50p income tax rate. How? “Investment in local schools,” he said. “And a message about responsible government.”

There is, of course, another reason Edinburgh Southern plumped for Johnson – independence. While Scottish Labour is officially against an independent Scotland, there is an active Labour for Scottish Independence group, and a widespread view that the party could change its stance.

“I addressed it early on,” Johnson said. “I made it clear I wasn’t in favour of a second referendum.” But he admits it is the “axis” of Scottish political divides. “We have to move it on from there. But by default, that is what it will be.”

Indeed, despite a mood of exhaustion among Scottish Labour campaigners, the referendum issue will not go away. After the UK as a whole voted for Brexit, Scots found themselves the outliers – every single council area voted Remain. As they digested the result, a Survation poll found 54 per cent of Scots wanted independence.

“The conclusions people draw from Brexit are really important, especially in Scottish politics,” Johnson said. He believes Scots will see the Brexit fallout as a test case for independence: “The SNP have a very, very hard job to convince people that independence is a sensible choice.”

Nevertheless, the SNP is still the party in power, and remains Labour’s deadliest rival in the battle of the door knocks.

Johnson, who is backing Owen Smith in the Labour leadership campaign, sees similarities between the SNP’s success and that of New Labour.

“They are very pragmatic and they definitely believe in occupying the centre ground,” he said. “But what they are much smarter at is having very clear, signposted policies.

“If you ask people what the SNP have done, they will be able to tell you. Free university tuition. Abolishing tolls on bridges.

“New Labour wasn’t good enough about being clear about what it delivered.”

In Tory-ruled England, desperate dissenters may be dreaming of a progressive alliance uniting parties of the centre-left. But Johnson is scathing about the idea.

“On so many levels the idea of a progressive alliance with the SNP is very misadvised,” he said. “It totally misunderstands what the SNP is interested in. The SNP doesn’t want to govern the UK; it wants to split it up. And they want to achieve that by bashing Labour in Scotland.”

Another idea floated is that of a separate Scottish Labour party, free to transform itself as the Scottish Conservatives have done. But Johnson is visibly frustrated by Labour politicians who give up on the idea of reclaiming Scotland.

“If they think like that, where does it stop?” he demanded. “The reason we are in this situation now is not at all different from the threat from Ukip. It is essential similar groups of people leaving Labour because of dissatisfaction with mainstream politics and looking for an alternative. “

He blames complacency on Labour’s most metropolitan MPs: “It is a London problem. If you speak to people in other parts of England they will recognise the sentiment.”

More than anything, he wants Labour to move on from the constitutional questions that threaten to unbalance it and focus on economic inequality: “Labour at its best it is about transforming people’s life chances.

“Until we can get back on to talking about how we can make real economic, we are going to find it very difficult.”