Combining multiple rest sensor properties with a template sensor

I am trying to get a sensor to show me past rainfall values on an hourly basis.
I would like the rain sensor to have properties for past_hour, past_3_hours, past_8_hours, past_24_hours, or something like that.
The values come from a rest interface. The url is date based and the returned data is a json formatted array, with rainfall per hour.

What would be the proper way to handle this. I need to sum up the hourly values, often across a date change.

My thinking is that I should have two rest sensors - one for today and one for yesterday, and they should have 24 parameters each, with the hourly values. They should update every hour (at least the one from today).

And then I should have a template sensor to sum up the correct parameters. I think this is doable, but I also think the templates are going to be quite complex.

Am I on the right track, or is there a much easier way to do something like this?