Walmart Inc., the discount store giant known for squeezing costs from its suppliers, last week flamed Tesla Inc., the solar-power, home-battery, and electric-car company, accusing it of poor-quality solar installations. The lawsuit alleges that the solar division started by Tesla CEO Elon Musk’s cousins installed dangerous rooftop electric systems that caught fire at seven Walmarts — in Maryland, Ohio, Colorado, and four California cities — and threatened to burn 241 other Walmart and Sam’s Club stores.

“Properly designed, installed, inspected, and maintained solar systems do not spontaneously combust,” Walmart said memorably in its complaint, filed in New York on Tuesday.

The fires, which cost Walmart “millions,” threatened gas lines, sent at least one firefighter to the hospital, and only avoided deadly catastrophes by a “stroke of luck.” Walmart called the repeated fires and poor subsequent inspection results proof of “years of gross negligence and failure to live up to industry standards."

The suit alleges that poorly trained installers that Tesla hired for Walmart were at fault, not the actual units. Tesla hasn’t filed a response to the suit and didn’t reply to a request for comment. In its SEC filings, Tesla says it uses company employees for residential installations and hires contractors for large commercial jobs, where the company admits it can be hard to find qualified installers.

Did Philadelphia avoid potential disaster by keeping Tesla Solar out of the city? City officials, pressured by the powerful building trades council headed by electrical workers’ Local 98 business manager John Dougherty, wouldn’t let nonunion Tesla in, said Ernani Falcone, a former energy adviser to Tesla. City officials “wanted a union shop. And Tesla was not. So it was impossible, we were not able to do anything in Philadelphia,” said Falcone, who said he routinely put in 75-hour weeks promoting Tesla Solar to suburban clients before he was laid off in general cutbacks in January.

Falcone describes a fast-changing business environment at Tesla Solar as the company sought to boost sales and meet its well-publicized debt load. “I had three sales managers and seven different business plans in eight months.”

He noted that, whatever may have happened with Tesla’s Walmart contractors, “all the work I had was done out of our shop in Norristown by Tesla employees. They did solid work. I hope they survive. The Earth deserves for them to survive.”

The Walmart suit shreds what was, as recently as last year, a green corporate effort heralded by both Tesla and Walmart to promote “renewable energy” — solar and other sources whose advocates claim is cleaner and more environmentally friendly than fossil fuels such as coal or natural gas.

“Tesla designed these systems and represented them as safe, reliable, and an environmentally conscious way for Walmart to reduce its energy costs,” wrote Walmart’s lawyers from New York-based Davis Polk & Wardwell. Tesla had promised Walmart it would maintain the systems, keeping them "perpetually safe and reliable.”

As fire reports mounted, Tesla agreed to disconnect the Walmart solar systems. But Tesla systems are dangerous even when they are disconnected, Walmart added: A Yuba City, Calif., Walmart’s Tesla rooftop solar system caught fire last November, five months after it was shut off. Walmart said independent investigators found that Tesla failed to secure loose electrical wires at the site, “creating a fire hazard.”

Joint Walmart-Tesla inspections at other stores in late 2018 found “numerous hot spots” and cracked insulation “visible to the naked eye or readily identifiable” with standard equipment, casting doubt on the quality of Tesla’s repairs as well as its maintenance.

Inspections in 2019 turned up more problems: All 29 stores reviewed through Aug. 16 showed signs of “gross negligence," and many were “unsafe.”

Walmart says it sued after Tesla was unable to trace the problems to “root causes,” leaving Walmart unwilling to turn the systems back on. The company has concluded that “Tesla is incapable of maintaining solar systems in a safe condition” since it failed to hire or contract enough "qualified solar professionals” to do the work.

When Walmart began its own review, the company says, it "quickly discovered that Tesla routinely deployed individuals to inspect the solar systems who lacked basic solar training and knowledge,” who did not know, for example, "how to conduct inspections or how to use simple tools.”

Walmart traced the problems to Musk’s 2016 decision to “bail out flailing” SolarCity, a company started by two of his cousins in 2004, for $2.6 billion in stock, plus billions in SolarCity debt that Tesla took over. The purchase was criticized by some Tesla-watchers, for boosting the company’s debt load with a competitive business that has been losing federal tax breaks, and for making the company’s cash flows harder to track.

“SolarCity had adopted an ill-considered business model that required it to install solar panel systems haphazardly and as quickly as possible in order to turn a profit,” using local contractors and subcontractors who “had not been properly hired, trained, and supervised," according to the suit. The construction “deviated substantially” from plans, making it tough, for example, for firefighters to find switches where they were supposed to be."

“SolarCity’s goal was to install as many solar systems as quickly as possible,” generating more sales. The strategy “was a bust,” and as financial pressures built before the Tesla takeover, the company’s share price fell and its debt soared.

SolarCity installed panels at more than 80 Walmart stores in one year — far too fast for “adequate quality-control checks,” Walmart now alleges.

On March 7, 2018, Walmart staff and shoppers at a store in Beavercreek, Ohio, reported “light smoke haze” inside the store. Inspectors blamed an overheated inverter unit (which converts solar-generated direct electrical current to alternating current that the store can use), and found that it had been secured with improper brass bolts in violation of the National Electrical Code. The bolts melted in the fire. The inverter also lacked a waterproof seal; the box got wet, “likely contributing to the fire’s ignition.” Fire damage there totaled nearly $800,000.

On May 21, a fire at the Denton, Md., store, which cost Walmart $100,000, was also traced to an inverter. Eight days later, employees at the Indio, Calif., store saw smoke rising through a skylight and called firefighters, who found the solar panels “engulfed in flames” as staff and customers fled. Damage and costs there totaled $8.2 million. Investigators found "module hot spots, improper grounding and wiring methods,” and bad electrical connections.

Earlier fires at four other stores caused damage and costs estimated to total over $600,000. Inspectors found more hot spots “plaguing Walmart’s roofs” and threatening fires at additional stores. The bottom line, according to the lawsuit: “Walmart stores with Tesla solar panels were unsafe for shoppers and employees,” especially if the systems were turned on.

Walmart says it sued after Tesla missed deadlines to fix the problem and pay for damage. It is suing for breach of contract and negligence. Walmart wants Tesla to pay for damage from the fires, remove its solar systems, and pay additional costs.

On Friday Aug. 23, the two companies issued a brief statement noting that they would try to resolve their differences and get the solar systems running again.