I have an energy consumption sensor that provides daily readings in kilowatt-hours (KWh), and it resets at midnight each day. My goal is to aggregate the daily consumption data to track the total energy consumed for the entire month. Additionally, I want to align this monthly cycle from the 13th of one month to the 12th of the following month. How can I achieve this data aggregation and cycle synchronization?
First, create a forever increasing helper using the
Then, you can create all the utility meters you want that match your periods
Using the parameter offset
to match the 12-13 constraint
offset:
days: 12
offsetting 12 days will add 12 days to the first day of the month, so reset on the 13th.