The Internet of Things (IoT) is getting important and interconnected technologies of the world, consisting of sensor devices. The internet is smoothly changing from an internet of people towards an Internet of Things, which permits various objects to connect to another wirelessly. The energy consumption of the IoT routing protocol can affect the network life span. In addition, the high volume of data produced by IoT will result in transmission collision, security issues, and energy dissipation due to increased data redundancy because tiny sensors are usually hard to recharge after they are deployed. Generally, to save energy, data aggregation reduces data redundancy at each node by turning some nodes into sleep mode and others into wake mode. Therefore, it is important to group the nodes with high data similarity using the fuzzy matrix. Then, the data received from the member nodes at the Cluster Head (CH) are analyzed using a fuzzy similarity matrix for clustering. In the next step, after clustering, some nodes are chosen from all groups as redundant nodes. The sleep scheduling mechanism is then applied to reduce data redundancy, network traffic jamming, and transmission costs. We have proposed an Energy-Efficient Data Aggregation Mechanism (EEDAM) secured by blockchain, which uses a data aggregation mechanism at the cluster level to save energy. As edge computing is used to provide on-demand trusted services to IoT with minimum delay, blockchain is integrated inside a cloud server, so the edge is validated by the blockchain to provide secure services to IoT. Finally, we performed simulations to calculate the performance of the proposed mechanism and compared it with the conventional energy-efficient algorithms. The simulation results show that the proposed structural design can successfully reduce the amount of data, provide proper security to the IoT, and extend the wireless sensor network (WSN).