The present invention relates to an apparatus for heating fluid in a pipe system, comprising: a first burner for heating pipes of the fluid circuit; a feed for air and/or fuel for causing combustion of this mixture by the burner; a second burner for heating a head of a generator for generating electrical energy; and an outlet pipe for discharging flue gases from the second burner into the space where the first burner is situated.