i’m pretty new to openhab and the reason of this post is not to have a working out-of-the-box solution, but to understand how i can implement this thing:
I have a Raspberry Pi that sends over MQTT the istant values of elecricity consumption, and this works well and stores data in rrd4j persistence.
My idea is to implement InfluxDB+Grafana for better charting so my question is:
What’s the best way to store in InfluxDB the average of the istant values every 5 minutes?
I mean data starts to arrive on Openhab at xx.00; at xx.05 i have 5 minutes of data and i want to store just the average of this values.
I was thinking of stores the data from 00 to 05 minutes somewhere, and then calculate the average and stores the result on Db, but maybe there is a way to do this average on-the-fly.
What do you think? any better ideas?
Thanks in advance for your advice