Ambient Intelligence and Ambient Assisted Living systems are required to provide a natural user experience, where the interaction is resolved by using devices and modalities adapted to the user abilities and preferences, and even to the environment conditions. Because of the variety of devices and technologies, and the diversity of scenarios, developing these interaction systems is a complicated task. This paper proposes an UI abstraction framework for the development of AmI and AAL systems that effectively improves the portability of those systems between different environments. It allows developers to design and implement a single UI capable of being deployed with different devices and modalities regardless the physical location.