One of the greatest challenges for long-term emissions reduction is the decarbonisation of heating and cooling due to the large scale, seasonal variation and distributed nature. Energy flexible buildings with electric heating, smart demand-side management and efficient thermal energy storage are one of the most promising strategies to deploy low-carbon technologies which can benefit the electricity system by reducing the need of reinforcing existing networks and their ability to use electricity in times of low demand and high supply. Combined with spot price contracts, in which the electricity tariff changes every half-hour depending on supply and demand, they can effectively reduce on-peak demand periods, achieve economic profits for end-users and retailers, and reduce the environmental impact of the electricity grid by operating in periods with lower CO2 emissions rate. To achieve these benefits, it is crucial to develop accurate models for energy flexible buildings as well as control strategies to optimise the complex system operation. This paper proposes a novel flexible energy building concept, based on smart control, high density latent heat storage and smart grids, able to predict the best operational strategy according to the environmental conditions, economic rates and expected occupancy patterns. The smart integration model, carried out in TRNSYS for a Scottish case study, solves a multi-criteria assessment based on future energy demand prediction (learning machine model supported by end-user's predefined occupancy by Internet of Things, present and forecast weather data, and building load monitoring), electricity tariff evolution and building performance. The results show that end-user's electricity bill savings of 20% are obtained and retailer's electricity cost is reduced by 25%. In addition, despite an increase in final energy consumption of up to 8%, the environmental impact remains constant due to operation at times with lower CO2 emissions rate of the electricity generation. The developed tools enable the design of smart energy systems for energy flexible buildings which can have a large, positive impact on the building sector decarbonisation.