Energy-saving offices require autonomous and optimised control of integrated devices and appliances with the objective of saving energy while the occupant comfort and productivity are preserved. We propose an approach that analyses and controls an office space and accounts for the objectives of energy-saving offices. The approach considers ontology-based occupant activity recognition using simple sensors to process the context information, and employs Artificial Intelligence planning to control appliances. The approach is evaluated in a semi-simulated setting. The activity recognition strategy is tested in an actual living lab and shows recognising accuracy of about 80%. The planning technique is able to cope efficiently under a simulated a...