Energy in buildings covers a major and wide range of subject, which has attracted a great interest of the academic sector in recent years. Due to the high share of the global primary energy consumption associated with buildings, many studies have been published toward energy efficient buildings and the reduction of their primary energy consumption and energy management and optimization, for both Renewable Energy Sources (RES) and non-RES. As a result, a plethora of methods for managing the energy consumption and optimizing the integration of the RES in buildings have been proposed. The optimized dispatch of battery energy seems a promising method for managing the energy consumption profiles within buildings and achieving energy targets such as nearly Zero Energy Buildings (nZEBs). The current paper attempts a review of various studies related to convex mathematical optimization techniques for reducing the energy consumption in buildings, in real-time and via storage, either with or without integrated RES.