The intensification of global climate change and the significant increase of extreme rainfall events have made traditional urban drainage systems face great adjustments. As a key component of green infrastructure to avoid urban flood risk, green roofs are receiving increasing attention due to their unique capabilities in stormwater management. This paper explores the potential of Internet of Things (IoT) technology and sensor networks to enhance green roof stormwater management. Integrated real-time monitoring of key environmental parameters, including soil moisture, temperature and rainfall, enables the system to dynamically adjust roof drainage and irrigation strategies. This greatly improves the rainwater retention capacity and reduces the pressure on the municipal sewage system. The results show that the combination of IoT technology and sensor networks not only improves the efficiency of green roof management in combating climate change, but also promotes the efficient use of water resources and enhances the adaptability and sustainability of the system. This research provides the necessary technical support for the wider adoption of green roofs in urban environments and offers viable solutions to future challenges posed by climate change.