Walmart Inc. is suing Tesla Solar for breach of contract over what it says are faulty, poorly installed rooftop solar panels that caught fire at seven stores.

Walmart’s lawsuit filed in New York County Supreme Court alleges that the negligent installation, operation and maintenance of the roof solar panels resulted in the fires.

Although Tesla is the company being sued, most, if not all, of the solar panels were constructed by SolarCity, which Tesla purchased in 2016 before production began in Buffalo.

Walmart alleges in court documents that all 248 stores that have the roof solar panels are at risk of fires.

At-risk stores include one in Hamburg and one in North Tonawanda, according to a list included in court documents.  

As part of the agreement, Walmart says Tesla retained ownership of the solar systems and agreed to design, install, inspect and maintain them. Walmart says that by May 2018, Tesla agreed to de-energize the solar systems at all 248 Walmart stores.

But even that did not prevent at least two more fires, including one in Yuba City, California.

“Wires on the store’s rooftop were still sparkling at the time that Walmart discovered the fire and could have ignited more extensive flames, with potentially devastating consequences,” the lawsuit states.

“Equally troubling, after Tesla technicians visited the rooftop, one of the technicians failed to close the cover to a combiner box, exposing this important piece of equipment to the elements and thereby creating a fire hazard.”

It’s unclear what additional steps Walmart or Tesla has taken at the remaining stores, including the ones in Hamburg and North Tonawanda. Neither of the companies would answer specific questions.

On Monday, Walmart and Tesla released a joint statement that states: “Walmart and Tesla look forward to addressing all issues and re-energizing Tesla solar installations at Walmart stores, once all parties are certain that all concerns have been addressed.”

After four fires in 2018, crews from both companies began inspecting various sites and found dozens of problems, many of which Walmart alleges were visible to the naked eye or easily identifiable with standard equipment.

Some of the problems included panels that had excessive temperatures called hotspots, micro-cracks, dangerous wiring connections and ungrounded systems.

“These visits revealed that Tesla had engaged in widespread, systemic negligence and had failed to abide by prudent industry practices in installing, operating, and maintaining its solar systems—conduct that greatly increased the risk of fire at Walmart sites,” the lawsuit charges.

Walmart said of the 29 stores inspected as of Aug. 16, Tesla identified 157 action items to fix, including 48 that it identified as conditions that rendered the stores unsafe or potentially unsafe.  Neither Walmart nor Tesla would elaborate on which stores have been inspected so far.

“The more Walmart looked into the details, the more deficiencies it identified,” the lawsuit states.

“Site after site displayed troubling problems that were indicative of widespread negligence and were inconsistent with any suggestion that discrete or isolated problems had caused the seven fires.”

One of those fires on May 29, 2018, in Indio, California, resulted in injuries to two firefighters and a store associate and millions of dollars in damages.

Another fire on March 7, 2018, at Walmart’s Beavercreek, Ohio, store caused hundreds of thousands of dollars in damages, leaving the store closed for eight days.

A series of letters between attorneys for Walmart and Tesla reveal that the two sides had been trying to work out an agreement for months, with little success.

Tesla accused Walmart of having a “vehement” tone to its letters, for creating obstacles to resolving the dispute and providing no factual basis that every one of the 248 stores with roof solar panels faces an imminent risk to safety or property.

“We do not agree that Tesla negligently failed to properly install, maintain, and operate those systems, as you claim,” wrote Fred Norton, an attorney for Tesla.

James P. Rouhandeh, an attorney for Walmart, shot back another letter two weeks ago that criticizes Tesla for failing to provide analyses of the root causes of each fire and conducting improper inspections.

“Tesla’s repeated inability to demonstrate that it knows how to care for solar panel systems has stymied Walmart’s persistent efforts to achieve this objective,” Rouhandeh wrote.