This paper discusses the application of gamification techniques in the Ambient Intelligence context. A three-layer framework for ambient intelligence based on the concept of interconnection among all actors involved in the intelligent environment is first delineated. Then, mechanisms for user-driven creation and modification of environment behavior are advocated in the user layer. For this purpose, event-condition-action rules are promoted in literature. With this position paper we would like to suggest that user interfaces for rule construction must be integrated with proper techniques for user engagement and motivation, such as those proposed in the gamification theory