I would suggest using the same method as I used for cumulative rainfall. Store in an MQTT value and update it each day / week / month etc for your prior cumulative value, from this you can calculate the period value.
see How to: Daily rain sensor from cumulative sensor using MQTT and template_sensor