Rain in the last days from a counter of a flipping bucket rain gauge

If I understand your original goal correctly, you want to present rainfall information that is not bounded by midnight or similar chronological transitions.

You can maybe draw on this thread for ideas.
https://community.home-assistant.io/t/diy-zigbee-rain-gauge/255379

And this specific post in that thread for the approach that I took for total rainfall amounts looking back from the present for different finite time periods. The flaw of Utility Meter for this kind of use is that it is bound to fixed time periods that are defined by chronological time boundaries. For me it is far more valuable for things like rain to be presented with data looking back specific periods of time with no consideration of the midnight day crossings, or week end / starts etc.
https://community.home-assistant.io/t/diy-zigbee-rain-gauge/255379/359

But that approach bumped into a behavior of statistics and how it handles the recording of repeated values as discussed here - and with a workaround.
https://community.home-assistant.io/t/statistics-sensor-becomes-intermittent/591213

And here.
https://community.home-assistant.io/t/improved-handling-of-repeated-sensor-values-which-are-presently-ignored/637736

Since you are starting with sensor values that are only provided on a bucket tip, your configuration will be some different. My configuration provides a “measurement” once per minute around the clock, so it has days, or even weeks of 0.00 values.

It is not entirely clear to me if you will run into the same repeated values issue or not if you start using statistics. Just wanted to call attention to it in case that you do. It is a bit maddening at first trying to figure out why rain amounts get missed, and do so seemingly randomly.

2 Likes