When wireless sensor networks are used in smart homes, the connection state will be unstable due to signal masking attenuation. This will cause low packet rate, high time delay and high cost in the network. In this paper, a network routing algorithm for wireless sensing based on connection conditions is designed. Secondly, the expected number of sends is proposed to evaluate the stability of links. Based on this, the following network signal delivery situation is forecasted in real time and quickly. According to the estimated expected number of transmissions, the path is dynamically corrected to effectively avoid attenuation in the channel and achieve optimal system performance. Experimental results show that the method proposed in this paper can improve the efficiency of message sending and reduce the routing cost under the condition of masking effect.