Problem with RRD4J item persistence, no chart data

  • Platform information:
    • Hardware: Intel Atom x5-Z8350 / 4GB RAM
    • OS: Windows 10 Enterprise
    • Java™ SE Runtime Environment (build 1.8.0_261-b12)
    • openHAB version:2.5.10

I am new to OpenHAB.
Configured two Things bounded to external MQTT and added two channels for both, then linked Items. All from PaperUI. Now I have four items:
DHT1_Temperature,
DHT1_Humidity,
DHT2_Temperature,
DHT2_Humidity,

For now, I just wanted to set up a temperature chart.
I installed RRD4J persistence and configured as follows:

\openhab-2.5.10\conf\services\rrd4j.cfg:
.items=DHT1_Temperature,DHT1_Humidity,DHT2_Temperature,DHT2_Humidity

openhab-2.5.10\conf\persistence\rrd4j.persist:
Strategies {
everyMinute “0 * * * * ?”
everyHour : “0 0 * * * ?”
everyDay : “0 0 0 * * ?”
// if no strategy is specified for an Item entry below, the default list will be used
default = everyUpdate
}
Items {
// persist the Item state of Heating_Mode and Notifications_Active on every change and restore them from the db at startup
// Heating_Mode, Notifications_Active: strategy = everyChange, restoreOnStartup

    // additionally, persist all temperature and weather values every hour
    DHT1_Temperature : strategy = everyUpdate
	DHT1_Humidity : strategy = everyUpdate
    DHT2_Temperature : strategy = everyUpdate
	DHT2_Humidity : strategy = everyUpdate
	* : strategy = everyUpdate, everyMinute

}

I have a sitemap including charts for these items:

sitemap demo label=“Vérteskozma” {
Frame label=“Demo” {
Text item=DHT1_Temperature label=“Indoor temp [%.1f °C]”
Text item=DHT1_Humidity label=“Indoor humidity [%.1f %%]”
Text item=DHT2_Temperature label=“Outdoor temp [%.1f °C]”
Text item=DHT2_Humidity label=“Outdoor humidity [%.1f %%]”
Chart item=DHT1_Temperature period=D refresh=30000 visibility=[chart_period==0, chart_period==“Uninitialized”]
Chart item=DHT1_Temperature period=W refresh=30000 visibility=[chart_period==1]
Chart item=DHT1_Temperature period=M refresh=30000 visibility=[chart_period==2]
Chart item=DHT1_Temperature period=Y refresh=30000 visibility=[chart_period==3]
}
}

I can see the Item values on the sitemap, but the chart is empty even after a long time and several restarts of OH. Looks like no data is collected or persisted.

Any idea please what can be wrong here ?

Not sure if the problem comes from the fact that the Items were created via PaperUI and hence are not listed in any .Items file.Perhaps the persitence related config files can’t refence items created that way ?

Thanks.

/* A side note :
To tell the truth I have never seen such a popular framework that is so much user unfrendly. Can’t understand its popularity, despite all the flexibility it can provide. Config files everywhere…no default database support…manual sitemap file creation…super complicated task to simply add a chart…all this in 2020…OMG…
Nevertheless, still fighting with it for a whikle*/

Use REST API to find out if your Items have persisted data.

REST API, of course, I see. Thank you.
I think I am going to write my own software instead .

Thank you, appreciate your help.

Looking at your persist file it looks like you are saving your DHT Items on every update. You don’t indicate how often those Items are updated. With rrd4j’s default config you must persist the Items at least every minute. If there isn’t a value at least every minute than charts cannot be generated.

In OH 3 which is about to come out there are almost no config files required.

Not everyone uses persistence. Not everyone wants to use the same database. But in OH 3 rrd4j is the default.

Then use HABPanel.

In OH 3 you can press “Analyze” almost anywhere in the MainUI and get a chart.

I’m not arguing against anything you said. I’m just pointing out that these are all things that are recognized and being addressed.

OH is not for everyone but there are thousands of people who have been successful with it who have little to no prior technical experience. It can be done.

1 Like

Thank you Rich, this all sounds very promising, happy to see these comments.

About DHT, the sensors send data every minutes. Now I am about to move to mySQL persistence since I can’t get a handle on what is going on within RRD4J.

Okay, so I managed to get it work, only took two days.

RRD4J persistence did not work, don’t know why.
MySQL persistence did not work, individual item tables were never created.
Finally JDBC - MySQL persistence did the trick. I did not change anything else only switched to this persistence service provider.

OMG, I am really looking forward to see if OH3 is any better…

My 2Cents
In your case I don’t think anything will change.
If persistence services, that are working for others, are not working for you, such is likely to happen again.

1 Like