Building-automation systems enable building administrators and inhabitants to monitor and control their buildings from within the building itself, as well as from outside using remote access tools. In recent years, many such control systems have been developed for both residential and nonresidential buildings, with increasing levels of functionality. Due to the growing number of building-automation system manufacturers, which use different network and communication protocols with no interoperability, it is often not possible to integrate the use of components from different manufacturers in a single building. To overcome this major limitation, we have developed a multilayer architecture for buildingautomation, designed to allow remote management of buildings, while making it possible to use components from different manufacturers. Our architecture implements an advanced secure interface for building-automation software, using secure event-handling and Role-Based Access Control (RBAC). The architecture is designed to provide energy consumption and monitoring applications with an interface protecting their privacy.