This paper introduces the architecture of an emotion-aware ambient intelligent and gerontechnological project named "Improvement of the Elderly Quality of Life and Care through Smart Emotion Regulation". The objective of the proposal is to find solutions for improving the quality of life and care of the elderly who can or want to continue living at home by using emotion regulation techniques. A series of sensors is used for monitoring the elderlies' facial and gestural expression, activity and behaviour, as well as relevant physiological data. This way the older people's emotions are inferred and recognized. Music, colour and light are the stimulating means to regulate their emotions towards a positive and pleasant mood. Then, the paper proposes a gerontechnological software architecture that enables real-time, continuous monitoring of the elderly and provides the best-tailored reactions of the ambience in order to regulate the older person's emotions towards a positive mood. After describing the benefits of the approach for emotion recognition and regulation in the elderly, the eight levels that compose the architecture are described.