Buildings have been an important energy consuming sector, and inefficient controlling of lights can result in wastage of energy in buildings. The aim of the study is to reduce energy consumption by implementing a smart lighting system that integrates sensor technologies, a distributed wireless sensor network (WSN) using ZigBee protocol, and illumination control rules. A sensing module consists of occupancy sensors, including passive infrared (PIR) sensors and microwave Doppler sensors, an ambient light sensor, and lighting control rules. The dimming level of each luminaire is controlled by rules taking into consideration occupancy and daylight harvesting. The performance of the proposed system is evaluated in two scenarios, a metro station and an office room, and the average energy savings are about 45% and 36%, respectively. The effects of different factors on energy savings are analyzed, including people flow density, weather, desired illuminance, and the number of people in a room. Experimental results demonstrate the robustness of the proposed system and its ability to save energy consumption. The study can benefit the development of intelligent and sustainable buildings.