The present paper describes an analysis of energy processes for supporting amicroclimate in animal farm buildings. The energy balance components are analyzed.Moreover, the process of energy exchange with the environment is investigated with specialemphasis on the principal factors and their influence on the energy exchange with theenvironment. An algorithm describing optimized process is synthesized. The algorithm itselfis based on the model that describes thermodynamic and energy process inside the farm.