In most German cities (and even many villages), district heating is a rather common utility offering. There's pipes everywhere to move around the hot water to people's homes, and the water is typically heated by the waste heat from gas plants and waste heat from factories (though increasingly being supplemented with giant heat pumps).

This isnt some novel thing in Germany, selling excess heat from some energy intensive commercial proccess is pretty standard. The local district heating operator probably took care of almost all the infrastructure for them.