The main constraints of a wireless sensor network are limited battery power and short lifetime. One of the main reasons of energy consumption is the data transmission. Each node senses the data and sends them over to the base station. The sensor data fusion reduces the volume of message transmission and makes the network energy efficient. In this paper, we have presented a data fusion algorithm which minimizes the computation cost, communication cost and in the same way it reduces the consumption of energy. The algorithm derives the state of the network using the concept of priority of the sensors. The proposed algorithm gives a better false alarm rate than the existing data fusion algorithm used in the coal mine.