In this paper, we present an approach to aggregating and using devices that support the everyday life of human users in ambient intelligence environments. These execution environments are complex and changing over time, since the devices of the environments are numerous and heterogeneous, and they may appear or disappear at any time. In order to appropriately adapt the ambient system to a user's needs, we adopt a service-oriented approach; i.e., devices provide services that reflect their capabilities. The orchestration of the devices is actually realized with the help of Artificial Intelligence planning techniques and dynamic service binding. At design time, (i) a planning problem is created that consists of the user's goal to be achieved and the services currently offered by the intelligent environment, (ii) the planning problem is then solved using Hierarchical Task Network and Partial-Order Causal-Link planning techniques, (iii) and from the planning decisions taken to find solution plans, abstract service workflows are automatically generated. At run time, the abstract services are dynamically bound to devices that are actually present in the environment. Adaptation of the workflow instantiation is possible due to the late binding mechanism employed. The paper depicts the architecture of our system. It also describes the modeling and the life cycle of the workflows. We discuss the advantages and the limit of our approach with respect to related work and give specific details about implementation. We present some experimental results that validate our system in a real-world application scenario.