It was pure poetic justice that the weather ruined Mayor de Blasio’s latest stunt — turning his plans to preen about his Green New Deal efforts outside Trump Tower into a humiliating debacle inside the building.

Forced indoors by rain, the mayor found his remarks drowned out by lobby music and protesters, some of whom ruined every picture by holding up “Trump 2020” and “Worst Mayor Ever” signs.

It’s justice because de Blasio’s approach is so cynical. The stunt targeted Trump buildings for their greenhouse-gas emissions even though several other edifices — Mount Sinai Medical Center, the Time Warner Center, the MetLife building — have bigger problems by the same standard.

And the standard itself is junk: It only threatens fines in 2030 — 11 years in the future, if buildings don’t refit to cut their emissions. Plus, more than half the city is exempted. Indeed, the scheme effectively targets industries that use a lot of energy, such as tech, media and life sciences — sectors that provide good jobs.

Anyway, the initiative for the law came from the City Council; de Blasio just rushed to take the credit and then to pretend that Trump buildings are particular trouble.

Yet the mayor’s green hypocrisy doesn’t end there. He has also come out against the proposed Williams pipeline, a billion-dollar project to bring natural gas to Brooklyn, Queens and Long Island. Without it, National Grid warns it will immediately have to start refusing new gas customers. And the mayor’s own aides warned last month that nixing the pipeline would increase the city’s reliance on higher-carbon oil — for a net loss in fighting climate change.

De Blasio is claiming that his Green New Deal will somehow make up the difference, but its promised payoffs are years in the future, and he’ll be long gone from office when those promises prove false.

The mayor, in short, is doing nothing about the real issues facing the city, just trying to polish his own image. He totally earned those “Worst Mayor Ever” signs.