RRD4J Monthly and Yearly not working


Sorry if this was asked already before, I couldn’t find a solution and yes, I searched :slight_smile: .
I use an RPi3 with OH2.0 Release. There I have the temperature and humidity comming from the weather binding.
I also have the RRD4J persistance running and it perfectly works for the last hour, day and week. It’s integrated like this in the sitemap:

				Frame {
				Switch item=Weather_Chart_Period label="Chart Period" icon="line" mappings=[0="Stunde", 1="Tag", 2="Woche", 3="Monat", 4="Jahr"]
				Chart item=gWeather_Chart period=h refresh=600 visibility=[Weather_Chart_Period==0, Weather_Chart_Period=="NULL"]
				Chart item=gWeather_Chart period=D refresh=3600 visibility=[Weather_Chart_Period==1]
				Chart item=gWeather_Chart period=W refresh=3600 visibility=[Weather_Chart_Period==2]

Now, whenever I click on the month (Monat) or year (Jahr), the chart disappears and there’s no message in the log. Just this, that doesn’t help:

2017-05-24 21:59:59.216 [ItemCommandEvent          ] - Item 'Weather_Chart_Period' received command 4
2017-05-24 21:59:59.228 [ItemStateChangedEvent     ] - Weather_Chart_Period changed from 3 to 4
2017-05-24 22:00:03.116 [ItemStateChangedEvent     ] - CurrDateTime changed from 2017-05-24T21:59:03.100+0200 to 2017-05-24T22:00:03.100+0200

Does it work as I expect at all, or do I do something wrong?

Thanks in advance,

rrd4j has a hard time dealing with time periods that don’t have data. I suspect that you don’t have a lot of data that covers the last month and year.

So you can take a wait and see approach once enough time has passed for there to be a full month’s worth of data and see if the chart starts working.

Beyond that, I’m not sure what I would try. If you want accurate charts for those longer time periods, you would be better served with a DB other than rrd4j anyway since rrd4j thins out the data with averages as is gets older. A popular approach is this one.

Hi Rich,

Thanks for your answer. I think I should get enough data for the last months, as it runs for nearly a year. With some smaller interruptions.
But I already thought that rrd4j is not the best solution for this. Anyway, I’m looking for an easy solution as this is not of a high priority for me :slight_smile:
I’m going to have a look at what you suggested.

By the way: myopenhab seems to work as persistance as well, is that correct? Which database system does it use?


That is not correct. The old way used to use a .persist file to define which Items get exposed to my.openhab for third party integrations (e.g. IFTTT). The service only “saves” the most recent value and you can’t create charts with it nor can you query it from your rules.

OK, got it. Thanks

If the displayed part of your sitemap-file is the complete section for the chart, there are NO SETTINGS for a monthly or yearly chart. Or did you just not post it all?


I thought it’s enough with this:

mappings=[0="Stunde", 1="Tag", 2="Woche", 3="Monat", 4="Jahr"]

Where Monat means month and Jahr means Year.

What is missing?


Missing are the lines for the chart, there is none for month (3) and year (4).


yeah, now it makes sense. Thanks, that solved it :slight_smile: