The traditional routing algorithms for data transmission in the wireless sensor network (WSN) under the ubiquitous power Internet of Things (UPIoT) are faced with two common defects, namely, the imbalance between the nodes in energy consumption and the premature death of many nodes. To solve the problems, this paper puts forward a method to manage the energy efficiency and optimize the route for the WSN under the UPIoT. Firstly, an energy consumption model of network nodes was established after analyzing the causes of node energy loss, which effectively reduces the energy consumed by each node during the clustering process. Next, the author designed a way to compute node quality, and selected cluster heads by node quality, such that the energy consumption is balanced across the WSN. On this basis, a node clustering routing algorithm was presented to dynamically adjust the communication radii of cluster heads and general nodes, thus extending the lifecycle of the WSN under the UPIoT. The simulation results show that our method outperformed the traditional clustering routing algorithm in controlling energy loss of nodes and enhancing network reliability and stability. The research findings provide a valuable reference for the efficient data transmission of the WSN under the UPIoT.