Mayor Bill de Blasio doesn’t like tall buildings. Last week, as New Yorkers sweated through a heat wave, he issued a late-night “emergency” edict Thursday directing “owners of office buildings 100 feet or taller to set building thermostats to 78 degrees” just in time for the Friday workday, and lasting through the weekend.

The order makes no sense as a serious conservation measure — and only points up the fact that maybe we’re better off when the mayor decides to stay out of town and out of the fray during a local challenge.

Hizzoner implied that unless he acted, the city’s real-estate owners would have sent the grid into blackout. “Private office buildings will also have to do their part” to “reduce strain on the electrical grid.”

One problem: Private office buildings already do their part. Con Ed, the electric company, has long had a “demand-management program” for large customers, including office buildings. Last Friday, at least one major developer already planned to set the temperature at 75 across a portfolio of buildings.

“Like many de Blasio things,” another big developer told me Friday morning, “it’s fake.” Indoor temperature “isn’t the metric,” the developer noted. “It’s the reduction in energy.” Highly efficient buildings can stay at 72 and still use less power than a less efficient building at 78.

And, of course, if the problem is cooling tall buildings, why not issue the same edict to any apartment towers, luxury or not, with central air? People will have the same breathing problems whether they are at work or at home.

A second problem: The mayor’s sudden edict sends the wrong message to the business community, creating an unpredictable crisis atmosphere. Con Ed didn’t ask for this blunt, sudden intrusion. Company president Tim Cawley said on Friday that the 78-degree requirement “comes from another source,” referring — obliquely — to the mayor.

Cawley did gamely note that Con Ed has set the temperature to 78 at its own headquarters. But that’s a political response to the mayor’s decree, not an engineering solution.

As of early Friday afternoon, Con Ed claimed to be ready to meet the day’s peak demand. “We designed for around 13,300 megawatts,” Cawley said. Around noon, usage was 10,148. “The system is sound.”

That may or may not be true on any given day. But City Hall should hold the company to its statements, not randomly tell office tenants to stop using power.

The mayor’s declaration risks an irresponsible psychological impact, too. To the extent that anyone even pays attention to what de Blasio says, he preferred to panic people rather than let Con Ed try to manage the situation. When a building raises the temperature or dims the lights, the hope is that people won’t actually notice and get upset; they’ll just go about their business.

De Blasio abused his ability to issue an emergency order, politicizing this power. A useful emergency order, on a day with bad air quality, would be to restrict car entry into the city’s core to vehicles with at least three people. Ironically, the city’s tall buildings are keeping the air clean, not making it dirty — because our density keeps most people out of private cars. Vending carts, too, should be restricted from spewing charcoal and other particulate toxins into 95-degree air.

De Blasio’s goal here, though, had nothing to do with conserving energy or air quality. It’s all part of the national narrative he’s trying to build: The money (and, apparently, the electricity, as one Twitter wag noted) is “in the wrong hands.”

He wants to send the message to primary voters that he’s willing to do the hard things: let financiers and tech titans swelter in their suits in hot offices so that he can save the planet.

He’s counting on national voters to be unsophisticated about New York. Real New Yorkers know that few one-percenters are at their desks on a Friday in late July. They’ve left town for cooler climes, leaving middle-class staff, who don’t have the flexibility to cut out for “summer hours,” to swelter.

Nicole Gelinas is a contributing editor of City Journal.