[SOLVED] RRD4J no charts

Thanks a lot!

This is the content of tmp:
image

I’m in a hurry now - but will try to delete the files as suggested in a few days. I’ll let you know whether it’s working then.

Looked into the PersistenceViewer again, did you show the items in the gR group?
This viewer will show them sorted into the groups ( groups are shown in green, click on them to show the items).

I’m back … and have cleaned the cache / temp and deleted all files in /rrd4j

Unfortunately the charts still don’t work :frowning:
I’m getting the same error as before:

 [WARN ] [thome.ui.internal.chart.ChartServlet] - Chart generation failed: null

Now there are only 3 files in /var/lib/openhab2/persistence/rrd4j/ folder

image

This fits to the rrd4j.persist file:

Strategies {
	// for rrd chart cron strategy every minute
	everyMinute : "0 * * * * ?"

	default = everyChange
}

Items {
    // gR* : strategy = everyUpdate, everyMinute
    SonoffS201_switch : strategy = everyUpdate, everyMinute
    EG_bad_x_tp1_switch : strategy = everyUpdate, everyMinute
    EG_bad_x_tp1_energyusage : strategy = everyUpdate, everyMinute

}

The persistence viewer for http://openhabianpi:8080/static/PersistenceViewer/?rrd4j shows exactly the same items as for http://openhabianpi:8080/static/PersistenceViewer/?mapdb (in a new private browser instance)

The different size of your .rrd files is odd. Did you customized the setup of rrd4j? If yes, please show the contents of the file.
Have you checked with the PersistenceViewer if there are chartable values in the rrd file?

Should all files have the same size?
I didn’t customize the rrd4j setup. The only thing I did is to do the openHAB setup via textfiles - the persistence services in addons.cfg:

# A comma-separated list of persistence services to install (e.g. "persistence = rrd4j,jpa")
persistence = mapdb,rrd4j

I just did a new install of RRD4J persistence from paper UI - but with the same outcome.

It’s crazy that the persistence viewer shows so many items (maybe an issue of the viewer …) - in contrast to the rrd4j folder:

When I click on a random item in the persistence viewer - it creates a new file in the rrd4j folder.
Each file has either 27 or 113 KB size.

According to the PersitenceViewer there are no (usable) values in the files.

Although there were values before I did the new install:

Each .rrd file using the same archive setup has the same size, which will never change. In your case the different size has to be caused by the different types stored. Please verify that the larger size is always coresponding to a non numerical item.
The actually used size for a numerical value stored is really low, I do not use the standard setup, so I can’t say what the size should be. If you had seen values for an item, did you try to chart exactly this item? In your initial post you tried that with an *rssi item, which has the larger .rrd file. Note that it may take some time for values to show up after you have deleted the files, also note that the values stored for each minute will show only if you request a timeframe less then the last eight houres! (the screenshot in the last post shows a request covering the LAST MONTH, therefore showing a value for each 12 houre timestep!).
The fact that the PersistenceViewer creates files is odd and should be looked on.Reporting this one. In my customized setup of rrd4j such files are not created (I think). My rrd4j.cfg states the items to be stored, so the Default of all items isn’t used.
[Edit:] I had to take the last part back, I also see “self-created” .rrd files.

Thanks for the explanation.

This seems to be ok.

I’m (almost) quite sure.

Which screenshot do you mean?

Thanks for creating an issue ticket.

Is there another option to have charts in the sitemap (e.g. influxdb)?

The very last one showing the PersistenceViewer with the item “EG_bad_x_tp1_energyusage” selected.

Charts can be created by nearly all persistence services ( not by mapdb).
I would not change the service and I still think that you would get a chart from a correctly persited numeric value. The reported issue should be of no concern, stick to the numeric items you are persisting and try to chart them (like a Chart for the item “EG_bad_x_tp1_energyusage”).
If I remember correctly there were some posts about the former ability of rrd4j to convert on/off or true/false items to numeric ones, but this is said to be gone.

I did another test run with one of my backup installations - openHAB 2.4.0-1 (Release Build).

Persistence:

Strategies {
    everyMinute:    "0 * * * * ?"
    every10Minute:  "10 * * * * ?"
    everyHour:      "0 0 * * * ?"
    everyDay:       "0 0 0 * * ?"
    default = everyChange
}
// When using rrd4j persistence, you must use the everyMinute (60 seconds) logging strategy. Otherwise rrd4j thinks that there is no data and will not properly draw the charts.

    EG_bad_x_tp1_switch: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_power: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_energyusage: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_rssi: strategy = everyMinute, restoreOnStartup
	

Sitemap:

    Frame label="RRD4J" {
        Text item=Gcharts {
            
            Chart item=EG_bad_x_tp1_switch refresh=60000 period=h legend=true
            Chart item=EG_bad_x_tp1_power refresh=60000 period=h legend=true
            Chart item=EG_bad_x_tp1_energyusage refresh=60000 period=h legend=true
            Chart item=EG_bad_x_tp1_rssi refresh=60000 period=h legend=true
            }
    }

Immediately there are charts:

So, the question is, what is different?

I really don’t know :frowning:
The .persist and .sitemap codes are quite the same.
The code below is from the buggy setup:

Strategies {
    everyMinute:    "0 * * * * ?"
    every10Minute:  "10 * * * * ?"
    everyHour:      "0 0 * * * ?"
    everyDay:       "0 0 0 * * ?"
    default = everyChange
}

Items {

    SonoffS201_switch : strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_switch: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_power: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_energyusage: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_rssi: strategy = everyMinute, restoreOnStartup
}
    Frame label="RRD4J" {
        Text item=Gcharts {
            
            Chart item=EG_bad_x_tp1_switch refresh=60000 period=h legend=true
            Chart item=EG_bad_x_tp1_power refresh=60000 period=h legend=true
            Chart item=EG_bad_x_tp1_energyusage refresh=60000 period=h legend=true
            Chart item=EG_bad_x_tp1_rssi refresh=60000 period=h legend=true
            }
    }

The only differences are (fresh) text file based installation - the setup (with charting) originated from an oH 2.2. installation including 2 version updates - and the usage of persistence viewer. Which I’ve installed after the problems occurred (as far as I remember) …

I think I’ll start from scratch with another fresh installation on a second SSD …

Good luck!

This is really crazy.

I did another attempt and installed openhabian from scratch.

  1. wrote the image file with Etcher to SSD
  2. booted the raspberry and went through the installation
  3. installed the RRD4J binding via paper UI
  4. copied the following stripped down versions of textfiles to raspi

tplink.things

tplinksmarthome:hs110:YYYY    "TP-Link: Zwischenstecker 1 - HS - HS110"        [ deviceId="XXXXXXXXXXXX", refresh=60 ]

home.items

Switch   EG_bad_x_tp1_switch         "Trockner - Switch"         <selfsocket>    (gM,gR,Gtplink,Gzstecker,Geg,Gbadeg)          {channel="tplinksmarthome:hs110:YYYY:switch"}
Switch   EG_bad_x_tp1_led            "Trockner - Switch Led"     <selfsocket>    (gM,Gtplink,Gzstecker,Geg,Gbadeg)          {channel="tplinksmarthome:hs110:YYYY:led"}
Number   EG_bad_x_tp1_rssi           "Trockner - Signal"         <selfsocket>    (gM,gR,Gtplink,Gzstecker,Geg,Gbadeg)          {channel="tplinksmarthome:hs110:YYYY:rssi"}
Number   EG_bad_x_tp1_power          "Trockner - Power"          <selfsocket>    (gM,gR,Gtplink,Gzstecker,Geg,Gbadeg)          {channel="tplinksmarthome:hs110:YYYY:power"}
Number   EG_bad_x_tp1_energyusage    "Trockner - Energy Usage"   <selfsocket>    (gM,gR,Gtplink,Gzstecker,Geg,Gbadeg)          {channel="tplinksmarthome:hs110:YYYY:energyUsage"}
Number   EG_bad_x_tp1_current        "Trockner - Current"        <selfsocket>    (gM,Gtplink,Gzstecker,Geg,Gbadeg)          {channel="tplinksmarthome:hs110:YYYY:current"}
Number   EG_bad_x_tp1_voltage        "Trockner - Voltage"        <selfsocket>    (gM,Gtplink,Gzstecker,Geg,Gbadeg)          {channel="tplinksmarthome:hs110:YYYY:voltage"}

rrd4j.persist

Strategies {
    everyMinute:    "0 * * * * ?"
    every10Minute:  "10 * * * * ?"
    everyHour:      "0 0 * * * ?"
    everyDay:       "0 0 0 * * ?"
    default = everyChange
}

Items {
    EG_bad_x_tp1_voltage: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_switch: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_power: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_energyusage: strategy = everyMinute, restoreOnStartup
    EG_bad_x_tp1_rssi: strategy = everyMinute, restoreOnStartup
}

test.sitemap

sitemap test label="Test" {
    Frame label="RRD4J" {
        Text item=Gcharts {
            Chart item=EG_bad_x_tp1_switch refresh=60000 period=h legend=true
            Chart item=EG_bad_x_tp1_power refresh=60000 period=h legend=true
            Chart item=EG_bad_x_tp1_energyusage refresh=60000 period=h legend=true
            Chart item=EG_bad_x_tp1_rssi refresh=60000 period=h legend=true
			Chart item=EG_bad_x_tp1_voltage refresh=60000 period=h legend=true
            }
    }
}

The outcome was the same as always:

[thome.ui.internal.chart.ChartServlet] - Chart generation failed: null

The next thing I’ll do is to try a fresh installation on an SD card - maybe there is something wrong with RRD$J in connection with SSD???

Is it correct that persistence-rrd4j is version 1.13.0 - according to paper UI?

The version is correct.
What is your default persistence service in PaperUI? Rrd4j needs to be set there or it needs to be specified in the chart line.

BTW: My raspi is running openhabian from a ssd!

This field is currently empty. But the only persistence I’ve installed is RRD4J

As said before, the chart needs it either there or in the defining line.

BTW: You had it set in your original post!

IT WORKS NOW :smile:

I did a new install on an SD card - and tried the steps above … still didn’t work.

THEN I came across @P4trick’s thread … installed InfluxDB+Grafana - and finally, the charts are back (which is very strange)

image

Next step is to try it on my live system.

Just to understand you are still using rrd4j?

Yes - only RRD4J in this test setup.