# RRD4J Monthly and Yearly not working

**URL:** <https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931>\
**Category:** Persistence Services\
**Created:** [May 24, 2017, 8:02pm UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931 "2017-05-24T20:02:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![viktor\_Sc](https://community.openhab.org/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@viktor\_Sc](https://community.openhab.org/u/viktor_Sc)\
**Post date:** [May 24, 2017, 8:02pm UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931/1 "2017-05-24T20:02:51Z")

</div>

Hi,

Sorry if this was asked already before, I couldn’t find a solution and yes, I searched 🙂 .  
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:

```php
				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:

```auto
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,  
Viktor

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [May 24, 2017, 8:10pm UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931/2 "2017-05-24T20:10:06Z")

</div>

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](https://community.openhab.org/t/influxdb-grafana-persistence-and-graphing/13761).

---

<div class="post-metadata">

**Author:** ![viktor\_Sc](https://community.openhab.org/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@viktor\_Sc](https://community.openhab.org/u/viktor_Sc)\
**Post date:** [May 24, 2017, 8:15pm UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931/3 "2017-05-24T20:15:29Z")

</div>

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 🙂  
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?

Thanks,  
Viktor

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [May 24, 2017, 8:40pm UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931/4 "2017-05-24T20:40:47Z")

</div>

> [@viktor\_Sc](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![viktor\_Sc](https://community.openhab.org/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@viktor\_Sc](https://community.openhab.org/u/viktor_Sc)\
**Post date:** [May 24, 2017, 8:47pm UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931/5 "2017-05-24T20:47:45Z")

</div>

OK, got it. Thanks

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [May 25, 2017, 6:02am UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931/6 "2017-05-25T06:02:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![viktor\_Sc](https://community.openhab.org/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@viktor\_Sc](https://community.openhab.org/u/viktor_Sc)\
**Post date:** [May 25, 2017, 10:37am UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931/7 "2017-05-25T10:37:24Z")

</div>

Hi,

I thought it’s enough with this:

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

```

Where Monat means month and Jahr means Year.

What is missing?

Thanks,  
Viktor

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [May 25, 2017, 11:27am UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931/8 "2017-05-25T11:27:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![viktor\_Sc](https://community.openhab.org/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@viktor\_Sc](https://community.openhab.org/u/viktor_Sc)\
**Post date:** [May 25, 2017, 11:57am UTC](https://community.openhab.org/t/rrd4j-monthly-and-yearly-not-working/28931/9 "2017-05-25T11:57:08Z")

</div>

Jürgen,

yeah, now it makes sense. Thanks, that solved it 🙂
