Our control system autonomously learns the thermal properties of a building and optimizes the heating control strategy. New control strategies and optimized parameters can reduce energy consumption significantly by a one-time and cost-effective retrofit. Installing the controller takes only a few hours. The intelligent system is self-optimizing and considers future weather conditions such as solar radiation forecasts. According to our results, it is possible to save up to 35% of heating energy and heating costs while maintaining the same level of comfort for the residents. Yuon controller can be used with all fossil and renewable heating systems as long as it has one centralized heat source. In a second our algorithms can be licensed to heat pump or other heat source producers.