OpenSprinkler / OpenSprinkler-Weather

OpenSprinkler weather service used to calculate watering scale for the OpenSprinkler Unified Firmware.
https://opensprinkler.com
63 stars 38 forks source link

Shift WUnderground to use precipTotal #85

Closed PeteBa closed 4 years ago

PeteBa commented 4 years ago

Reference discussion on Discord: here

Looks like using precipRate results in an over estimate of the total rainfall during the period. Particularly, if there is heavy rainfall at the moment of the observation. The WU site says:

precipRate = Rate of precipitation - instantaneous precipitation rate. How much rain would fall if the precipitation intensity did not change for one hour

This PR swaps to using precipTotal and calculating the difference between periods. Note that the total resets to zero at midnight so this approach will lose any rain that falls between the last reading of the day and midnight.