This study aims to address the challenges of climate change, which has led to extreme temperature events and reduced rainfall, using Internet of Things (IoT) technologies. Specifically, we monitored the effects of drought on maize crops in the Republic of Croatia. Our research involved analyzing an extensive dataset of 139,965 points of weather data collected during the summer of 2022 in different areas with 18 commercial sensor nodes using the Long-Range Wide Area Network (LoRaWAN) protocol. The measured parameters include temperature, humidity, solar irradiation, and air pressure. Newly developed maize-specific predictive models were created, taking into account the impact of urbanization on the agrometeorological parameters. We also categorized the data into urban, suburban, and rural segments to fill gaps in the existing literature. Our approach involved using 19 different regression models to analyze the data, resulting in four regional models per parameter and four general models that apply to all areas. This comprehensive analysis allowed us to select the most effective models for each area, improving the accuracy of our predictions of agrometeorological parameters and helping to optimize maize yields as weather patterns change. Our research contributes to the integration of machine learning and AI into the Internet of Things for agriculture and provides innovative solutions for predictive analytics in crop production. By focusing on solar irradiation in addition to traditional weather parameters and accounting for geographical differences, our models provide a tool to address the pressing issue of agricultural sustainability in the face of impending climate change. In addition, our results have practical implications for resource management and efficiency improvement in the agricultural sector.