In this article we will propose a formal model for smart spaces. The key ingredients of this model are user, sensors and actuators. We show how we can derive a programming model based upon knowledge and software engineering. We describe how to interpret the world using an ontology and use this ontology to describe the intentional effect of available actuators. The model is loosely based on the beliefdesire-intention model and is a significant simplification of other context aware middleware architectures. We demonstrate how we can implement this model using OSGi.