Weather forecasting is a growing area that predicts the weather that will occur in a particular place at a particular time. Weather forecasting is considered to be the most important part of research where many real-time issues arise. These are the requirements for wireless sensor networks to detect the weather. In this article we propose using the Mayfly Algorithm (MA) hybrid algorithm with Shuffled Shepherd Optimization Algorithm (SSOA). Experimental tasks are carried out with a set of climate data. Based on climatic parameters such as temperature, humidity and clouds, the data is divided into heat, wind and rain. From the result obtained, it is predicted that the weather will prove the proposed qualification methods at the level of accuracy. The result shows that the hybridized SSOA and MA method is efficient and accurate in predicting weather conditions. This experimental result is carried out by using Wireless Sensors Network and IoT on agricultural land.