RRD4J charts sum per month

Hello community,

I was wondering if somebody already found a working solution to create charts in openHAB 1.8.3 which shows a sum value per month of the last year. I’d like to give an example to clarify my requirements:

With my power meter I’m able to get the current power values every minute. This values are stored to rrd4j persistence service every minute. So far all charts are working and I’m also able to switch between day, week, month and year from within classic UI.

What I additionally need is a possibility to sum up or average all values e.g. per month and show a chart only of the sum values. It would be nice to get one value per month for power consumption to compare the different months per year. So the yearly chart should be based on 12 values.

I already know the usage of historic states function within rules. Maybe there is a already a working rule with some dummy items to write the appropriate values and create the chart afterwards?! I might be possible to create a rule at the end of each month, then sum up the values of current month and write it to rrd4j.

Do you know any other comfortable way to illustrate this kind of charts with rrd4j?

Thanks in advance!

Hi skidepp,

this will not work properly with rrd4j as persistence service.
rrd4j is a round robin database which do data compression with your saved values (= mean values).
The more your point of interest is in the past, the more the values are compressed.

I think it will be better to use another persistence service to store the exact values for every month. The database will not grow as much, because you have only a few values (one every month).

You need another tool to do the graphics, because rrd4j won’t do it…


Without looking deeper into it, I’d think the setup of RRD4J does not support that. The desired sum-value for a month would be a sum or whatever over 31 days, oh no , now I need 28 days…
RRD4J is build to keep a fixed size database for a fixed timeframe. There might be ways to get the sum for each couple of days, however this “couple of” needs to be fixed. Additionally I think you would get a “running” value, something like the sum of the last x days counting down from now and not from last midnight.

OK. I already expected that before :frowning: So maybe I’ll try another persistency service to save all values and create the charts afterwards.

However thanks for your support and personal thoughts. :clap:

I’ve been very happy with the InfluxDB Grafana combo.

1 Like

So in the meantime I also setup InfluxDB and Grafana. It’s working like a charm and I really like it. It’s simply phenomenal.

One open task is the integration into openhab 1.8.3 classic UI. This is really tricky and does not work as expected right now. I’m not sure if there is any trick on it but for my installation neither Image item nor Webview item are working well. It would be nice if there is a classic UI integration.

So maybe it’s time to upgrade to openhab 2 while family is celebrating Christmas :rolling_eyes: