Getting totals by day from a daily incremental sensor?

I have a sensor that tells me the total rain for each day. It increments throughout the day and resets at midnight in my local time each day. The last result for each day is the total rain for that day.

I want to be able to see the total rain for each day, and even better I would love to see by week, or month, or year or by specific date range…etc.

Is this possible in HomeAssistant?

Yes it’s possible in home assistant. You can use the integration integration to get the total rainfall over a period. You can get statistics on that as well. You’ll need to provide more information if you want help getting this done.

Sure, i’m familiar with integration sensors. What additional information do you need? The sensor is called sensor.daily_rain and it increments throughout the day and resets at midnight.

Are you suggesting something like this?

 - platform: integration
   unique_id: "total_daily_rain"
   source: sensor.daily_rain
   unit_prefix: in
   round: 2

increments as in counts up? or just shows you the current rain level at that moment?

If saturday’s daily_rainfall value at the end of the day was 0.5 and sunday’s was 0.7, I would love for the sensor to show me the total of 1.2. I’m not sure what the best way to manage this as, as I would also like to see how much rainfall we got this week, this month, this year…etc. I feel like there is a way to capture this but I’m not quite clear.

does this sensor count up? or does it report the current rainfall for this exact moment in time?

1 Like

It counts up and then resets to 0 at midnight in my local time

Then you could just set it up to output on the energy page. Otherwise you should be able to just use a statistic card pointing to that sensor with a specified duration of 7 days.

I tried that, it only allows a stat_type of change and when I manually select max in the code editor it just shows a ? as the result

https://www.home-assistant.io/dashboards/statistics-graph/

or

https://www.home-assistant.io/dashboards/statistic/#rolling-window

Yes but that is not showing me totals. It just shows the max for each day. I want to see total rainfall for certain periods. Sorry if that’s not clear

… choose sum

Yup, tried that. It’s incorrect. Appreciate the help here but I promise I’m not dull, been using HA for years but this one is perplexing me

… click week…

yes - I have tried all of those. It makes no difference and doesn’t sum for the days I have set for it to show.

Honestly I hate working with folks like you who are “trying to help” but also commenting in a way that is implying that I’m an idiot. Adding the “do this…” after each comment is smug and really uninviting in this community. I’ll find help elsewhere.

Because you keep showing me the same image over an over again without saying you tried any of that. I have no choice but to assume you aren’t trying those options.

Anyways, if you choose 7 days to show with week being your period and sum checked. It will give you what you want.

You said “click sum…”

Then in the next post you said “click week…”. You didn’t say to try doing both, so no it’s not the same image.

Yes, i’m following what you said and if you are annoyed by helping then please by all means don’t help

Well by all means, try things instead of giving up… This isn’t a help desk, it’s people guiding you. You might have to actually pull some weight when trying things. Sorry but I don’t have a sensor available at my disposal to work with here. So you have to do the leg work.

1 Like

This would also work with the stats card

  - type: statistic
    entity: sensor.daily_rain
    stat_type: change
    period:
      rolling_window:
        duration:
          days: 7