Smart Building is a technology that is on the rise in developed countries. The idea behind it is that a smart building should be able to recognize a variety of situations in itself and respond accordingly. An automated building management system is set up to automate the controls and to coordinate the separate building engineering systems; the system comprises subsystems to automate this or that segment of the equipment. Mathematical modeling and computer simulation is necessary to study the various modes, in which the engineering subsystems and the system as a whole may operate. From the mathematical standpoint, a smart building is a continuous-discrete or hybrid system that comprises multiple coordinated components of varying nature that can be described as continuous or discrete processes. This paper proposes a smart building model that can simulate the functioning of the core engineering subsystems as well as the algorithms behind them. The model is based on Matlab Simulink and uses the Simscape physical modeling library as well as the Stateflow library. The model employs specialized control algorithms to coordinate subsystems and optimize power consumption.