Abstract-Smart environments are places where different kind of embedded devices are interconnected in order to provide their occupants intelligent services improving their comfort and convenience. These smart environments are seen to be important for the future urban ecosystems in terms of user friendliness, quality of life, energy efficiency and sustainability. Lately such environments have become economically and technologically feasible due to the advancements in embedded and distributed technologies. Most of the novel infrastructures adopt smart technologies, while old infrastructures need a transition towards smart environments. Even though different technologies and devices are available, there is a need for an appropriate methodology and a system architecture for a smooth and profitable transition towards smart environments. In this paper we present a framework for creating personalized smart environments using wireless sensor networks. This framework, among other services that it provides, is able to identify people and take personalized actions such as control electrical devices based on their preferences and needs. We present, as a proof of concept, a real world deployment where two scenarios are implemented in two office premises.