Seamless power integration and building energy management