The INTrEPID project aims to develop technologies that will enable energy optimization of residential buildings, both performing an optimal control of internal sub-systems within the Home Area Network and also providing advanced mechanisms for effective interaction with external world, including other buildings, local producers, electricity distributors, and enabling energy exchange capabilities at district level.