I use a diy solution that is working flawlessly for over two years.
It consists in a cheap rain sensor board for Arduino connected to an Aqara flood sensor, everything mounted on a 3D printed case.
The mounting is so simple: you just connect the board to the exposed contacts of the flood sensor; if the board becomes wet the flood sensor contact is closed, and trigger any automation you want. I use this solution here to inform if there are open windows when it starts to rain.