OpenSprinkler Forums OpenSprinkler Unified Firmware Rain sensor configuration Reply To: Rain sensor configuration

#52150

Ray
Keymaster

I checked the source code, and I am pretty sure the rain sensor logging only occurs when sensor is deactivated:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/main.cpp#L604
so the time stamp is the moment it ended, not when it’s started.

Given that the rain sensor itself has a delay (which cannot be predicted), how do you want the manually set rain delay to interact with it? For example, when it rains, the rain sensor may be activated for 8 hours. If you want to have a manual 24 hours rain delay, do you mean 24 hours from the start of the rain, or 24 hours from the end (of the 8 hours)?

If you want the manual rain delay to be on from the beginning of the rain sensor activation, the easiest way is to go to this section:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/main.cpp#L599
which is where rain activation is detected, and add the following lines:

os.nvdata.rd_stop_time = os.now_tz() + (unsigned long) ?? * 3600;
os.raindelay_start();

where ?? is the desired number of hours. This way, it makes use of the rain delay function, which guarantees that it stops watering for that number of hours, and by the time that ended, if the rain sensor is still activated, it will continue holding off watering until rain sensor is deactivated. So this will whichever is longer, between the manual rain delay and rain sensor activation.