A hot water system and heating of a building was studied. The system contains a bio-fuel tank, boiler and radiators. The electro-thermal analogy was used in the modelling of the system and an electrical equivalent scheme was obtained based on the generalized heat model and the identification of the thermal parameters. An automatic water temperature control system with PI controller has been developed. A methodology is proposed for calculating the parameters of the controller under optimum control law and different values of the damping factor. A heat and power consumption in different modes of operation is calculated. Simulation results for the water temperature and the thermal capacity in the leakage of water from the boiler was obtained. The receive results were confirmed experimentally.