: Developing Ambient Intelligence applications is a very complex task since it implies dealing with low-level software and hardware resources. The use of a middleware platform may alleviate this task by providing a set of high-level and platform-independent services to these kinds of applications. Nevertheless, the tendency is that the middleware deployed in each device has a flat and homogeneous architecture, although these devices and the requirements of intelligence environments are heterogeneous. This implies the middleware software deployed in each device normally contains more functionality than strictly required, leading to waste resources so scarce in lightweight devices. But the configuration and deployment of a minimal middleware customized to a target platform is a complex task, due to the diversity of hardware and software present in devices and the variable requirements of ambient intelligence applications. In order to solve these shortcomings, we propose to customize the ...