Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve weather driver #119

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Improve weather driver #119

merged 2 commits into from
Jul 30, 2024

Conversation

rneswold
Copy link
Contributor

This version improves the precip-rate, precip-total, and precip-last-total devices.

Weather stations accumulate rainfall for 24 hours and reset the total at midnight. It doesn't matter how many separate storm systems occur, there's one total for the day.

This pull request identifies rainfall more than 10 hours apart as a separate event and updates the precip-last-total accordingly.

rneswold added 2 commits July 28, 2024 23:34
Previously, when both the precip rate and precip total went to zero,
the last total would get set to the total before it was reset. It
turns out that many weather stations simply accumulate all the day's
rainfall and resets at night, which is not a very smart algorithm.

The new algorithm is that the total gets reset (and the last total
gets updated) when the rainfall rate is 0 for a certain amount of
time. A Google search found some research that suggested a 10 hour
gap of rain was a good average to indicate separate weather systems.
So after 10 hours of no rainfall, the totals will get updated.
@rneswold rneswold merged commit 77e830c into DrMemCS:main Jul 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant