With the rapid advances in sensing and digital technologies, cyber-physical systems are regarded as the most viable platforms for improving building design and management. Researchers investigated the possibility of integrating energy management systems with cyber-physical systems to form energy-cyber-physical systems in order to promote building energy management. However, minimizing energy consumption while fulfilling building functions for energy-cyber-physical systems is challenging due to the dynamics of building occupants. As occupant behavior is a major source of uncertainty for energy management, ignoring it often results in both energy waste caused by overheating and overcooling as well as discomfort due to insufficient thermal and ventilation services. To mitigate such uncertainties, this study proposes an occupancy-linked energy-cyber-physical system that incorporates WiFi probe-based occupancy detection. The proposed framework utilizes ensemble classification algorithms to extract three forms of occupancy information. It creates a data interface to link energy management systems and cyber-physical systems and allows for automated occupancy detection and interpretation by assembling multiple weak classifiers for WiFi signals. A validation experiment in a large office room was conducted to examine the performance of the proposed occupancy-linked energy-cyber-physical systems. The experiment and simulation results suggest that, with a proper classifier and occupancy data type, the proposed model can potentially save about 26.4% of energy consumption in cooling and ventilation demands.