This paper presents a novel building automation system that is decentralized and flat-structured. Each zone of the building is fitted with a smart node. It is a smart agent, which collects, handles and sends out information to its neighbours. All the smart nodes form a network that can realize self-organization and self-recognition. All kinds of control strategies can be converted into series of decentralized computing processes carried on by the smart nodes. The principle and mechanism of this decentralized, flat-structured building automation system are described in detail, and two use cases including evacuation in emergency and control of parallel-connected pumps based on this new system are further introduced.