Heating, Ventilation, and Air Conditioning (HVAC) systems account for a significant portion of energy consumption within buildings. In order to balance the effect of thermal comfort vis-a-vis energy savings, HVAC control strategies have been proposed. However, the strategies are static and do not take into account dynamic changes of consumers, hence creating sub-optimal outcomes. This paper proposes DEMSA, a Digital Twin (DT)-enabled middleware for the self-adaptation of smart buildings. The DEMSA middleware interconnects and coordinates intelligent data exchange between the building edge server, digital twin and Artificial Intelligence (AI) planning nodes in order to invoke appropriate strategies. Moreover, DEMSA is paired with a self-adaptive mechanism that can detect the anomaly of generated planning and adaptively modify it. This process ensures balancing building energy consumption and thermal comfort requirements, without human intervention. The DEMSA middleware is described over a real smart space scenario..