I want to have an overview how much electricity i use each therefore i want following :
- Be able to see hourly for 24h graph how much has been used
- Be able to dig into the hour and see by minnute.
- Be able to see daily totals by day, month, year.
I get my data from Home assistant and i run influxdb 2.0 but i don’t know exactly how to aggregate data and what is the best practice to do what i want.
I can’t add attachments but here is a snippet of the data that i have uploaded to WeTransfer https://we.tl/t-8eABOk8tNT in CSV format.
Following querry shows a upgoing curve of the data :
from(bucket: “Home Assistant”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: ® => r[“entity_id”] == “filtered_kamstrup_counter”)
|> filter(fn: ® => r["_field"] == “value”)
|> filter(fn: ® => r["_measurement"] == “kWh”)
|> aggregateWindow(every: 1s, fn: last, createEmpty: false)
|> yield(name: “last”)
Do note that i just have a counter of the total kWh used and that just increases so i need to calculate how much was used during the window somehow.