This controller is suitable for use with automatic watering systems which expose the ability to disable the system by making a connection open circuit. Normally a rain gauge would be connect and the system would be disabled if more than a certain amount of rain had fallen. This really only solves half the problem, since it could start to rain heavily immediately after the garden has been watered.
My solution to this problem is use the Wunderground HTTP API to obtain both the rain that has fallen in the last day and the rain that is forecast to fall, to determine if the system should be enabled.
As my watering system controller is battery operated, this project too must operate with a battery. To avoid inconvenience the battery should last the 6 months during spring, summer and autumn when the system is required. This is achieved by minimizing current consumption in the circuit and using the deep sleep mode of the ESP32. The system is woken once per day by an interrupt from a real time (RTC) clock module.
The Loboris fork of Micropython for ESP32 is used as I found this was significantly more reliable establishing a connection to my WiFi router.
I used a poly-carbonate box with an O-ring seal and fitted a PTFE breathable vent (allows air, but not moisture through), so that pressure variations due to temperature changes do not cause seal failures resulting in moisture ingress. The electric connection to the water system is via two brass rods sealed with epoxy and protected by heat shrink tubing with internal adhesive.