Applications in smart buildings have shown potential for improving energy efficiency, automated operation, and for creating better living conditions for occupants. To achieve these goals requires effective collection and use of sensing data and collaboration among different subsystems such as Heating, Ventilation, Air-condition (HVAC), security, lighting and sensing subsystems. Data generated and used by these subsystems are heterogeneous and often contextualized to real-time conditions. Contextual information is often provided by subsystem vendors as "metadata", that is, the data about data. The multiplicity of vendors makes most metadata idiosyncratic without any consistent meaning or usage that can be directly inferred from such metadata. This makes them difficult to be useful. Vendors and building operators have to often "guess" based on the unstructured text of metadata written by different engineers. Converting building metadata to a machine-readable format usually involves significant manual effort. We envision building systems that are able to seamlessly exchange data across subsystems as well as across various building services in a programming framework. Such information exchange is mediated by timely sensor information, its automated organization and navigation, thus creating a technical basis for future `smart buildings'.
Methods and tools for automated handling of metadata are crucial to this vision. Second, we present an application programming framework comprised of machine learning algorithms to help organize the current unstructured metadata information from existing buildings into a structured format such as Brick+. Third, we propose an application workflow that relies only on a standard information model for unified and secure application deployment. Using Brick+, Scrabble and Plaster programming support tools, we have built an end-to-end applications and services framework for smart buildings. Using buildings on the UC San Diego campus, we describe and demonstrate the effectiveness of the proposed methods. We demonstrate several new applications, such as a personal thermostat application called Genie and an energy dashboard, that can be built and deployed with minimal human effort. In addition to the demonstrated value of metadata models and methods in building portable applications for smart buildings in this dissertation, we continue to pursue building a community of system builders for the smart building environments.