7 Day accumulated rain fall

Hi,

I currently use sensor.pws_precip_today_in.

So yesterday we had 2.5 inches, today its sunny. I would like to combine a weeks *y days) worth of this sensor to one sensors that shows me the accumulated rainfall over the past 7 days and use that to control the sprinker automateion.
I currently have history turned on and utlize the MySQL for storage.

Any ideas on how to do this.

Check out the history statistics sensor. This might do what you are looking for.

I don’t see a sum .

type (Optional): The type of sensor: time, ratio, or count. Defaults to time

Am I missing something.

Yes, I just double checked, maybe it is the statistc sensor. This does a total. Not sure about the 7 day window.

Edit: adjusting the sampling size might give you the 7day window.

This might work. If the Weather underground updates every 5 minutes that 288 a day. I can get the MAX for 288 updates and then another static to add the last 7 of those up. I will give it a shot.

Did you find a solution for this, @faspina?

I have a tipping bucket connected to HA via ESPEasy/mqtt and want to see statistics for last day, last 7 days, last month, so far this year, etc.

1 Like

I have not found a solution. I am about to buy a weather kit with a rain bucket so I really would like to get a last 7 day rain fall total.

Here is what i found, seems to work for me - you need to have your logger purge set long enuff.

 - platform: history_stats
    name: BR Ceiling Fan ON **today**
    entity_id: switch.br_ceiling_fan
    state: 'on'
    type: time
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'

  - platform: history_stats
    name: BR Ceiling Fan ON **Last 7** 
    entity_id: switch.br_ceiling_fan
    state: 'on'
    type: time
    end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    duration:
      days: 7

  - platform: history_stats
    name: BR Switch ON **Last 30**
    entity_id: switch.br_switch
    state: 'on'
    type: time
    end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    duration:
      days: 30

Have a look at how I keep 24 hour rainfall - you could extend it to keep rolling multiple days. I might even do that myself!