This paper presents a novel adaptable energy management system (EMS) for smart buildings. In this framework we model the consumption of living unit, and its exchanges with surroundings. A unit is well delimited space inside building, which information on electrical known. We assume that has no neighbors. Examples units are household, an office, restaurant or gym. explicitly consider impact outs...