Data-Driven Technologies for Energy Effeciency and Flexibility