This is an industrial IoT system designed and developed by us to reduce the energy consumption of buildings. It consists of two main parts: A dedicated web based application (software) and hardware including gateways and smart thermostats distributed in offices, while gateways are distributed in floors. We have two main types of smart thermostats: One type is for monitoring, control and planning Fan Coil Units (FCUs) and another type is for air conditioners. Each smart thermostat is equipped with sensors and actuators and also a novel algorithm that determines the heating/cooling demand of office; and subsequently tunes FCUs or air conditioners to regulate office temperature around the desired set point by minimum energy consumption. Also, our smart thermostats have the capability to determine offices with no occupants; and subsequently, turns off FCUs or air conditioners of offices with no occupants to reduce the energy consumption of building for heating and cooling. Our smart thermostats can be utilized using the web based application or as standalone. In standalone mode, each thermostat can be used and planned without connecting to the web application. In the web application mode, smart thermostats are connected to the web application using our gateways and so can be controlled and planned locally as well as remotely using the web application. In addition, following the computation of the heating/cooling demands of offices by smart thermostats, the heating/cooling demand of building is determined by the web application and translated to as an optimal set point for central boiler and chiller that can be applied to them using our smart engine room module for the maximum reduction in the energy consumption of building.