With its strong coverage, low energy consumption, low cost and great connectivity, the Internet of Things technology has become the key technology in smart cities. However, faced with a large number of terminals, the rational allocation of limited resources, the topology and non-uniformity of smart buildings, the fusion of heterogeneous data become important trends in Internet of Things research. As a result, this paper proposes a novel technique for processing heterogeneous temperature data collected by an IoT network in a smart building and transforms them into homogeneous data that can be used as an input for monitoring and control algorithms in smart buildings, optimizing their performance. The proposed technique, called IoT slicing, combines complex networks and clusters in order to reduce algorithm input errors and improve the monitoring and control of a smart building. For validating the efficiency of the algorithm, it is proposed as a case study using the IoT slicing technique to improve the operation of an algorithm to self-correct outliers in data collected by IoT networks. The results of the case study confirm, irrefutably, the effectiveness of the proposed method.