Energy efficiency of residential buildings is crucial to the global reduction of electricity consumption, as energy demand, in line with technological development and the increased availability of technology, is increasing. To optimize the functioning of smart buildings, an evolutionary algorithm that takes into account the criteria of energy efficiency and comfort of the user, is presented and developed. Instead of a single solution, it is possible to find a Pareto optimal front, consisting of trade-off solutions. By simulating different test scenarios we show that the algorithm finds trade-off solutions based on the initial schedule set by the user. The obtained solutions sacrifice comfort, but are more cost-effective.