Rrd4j doesn't render groups (it renders separate elements fine)

Hi Community

On a fresh openHABian install, I’m able to render all items separately in charts using http://openhab:8080/rrdchart.png?items=Thermo1_Chart&period=h

But when I try to render the group (with temp, min and max), it shows nothing with

The config is

			Frame {
				Switch item=Thermo1_Chart_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week", 3="Month", 4="Year"]
				Chart item=Thermo1_Chart period=h refresh=600 visibility=[Thermo1_Chart_Period==0, Thermo1_Chart_Period=="Uninitialized"]
				Chart item=Thermo1_Chart period=D refresh=3600 visibility=[Thermo1_Chart_Period==1]
				Chart item=Thermo1_Chart period=W refresh=3600 visibility=[Thermo1_Chart_Period==2]
				Chart item=Thermo1_Chart period=M refresh=3600 visibility=[Thermo1_Chart_Period==3]
				Chart item=Thermo1_Chart period=Y refresh=3600 visibility=[Thermo1_Chart_Period==4]
			}

and

Group	Thermo1_Chart	(gChart,Weather)
Number Thermo1_Temperature "Temperature [%.1f °C]"  <temperature>	(gChart, Thermo1_Chart) { channel="rfxcom:temperaturehumidity:189cc8fd:thermo1:temperature" }
Number   Thermo1_Temperature_Min         "Temperature Min [%.1f °C]" <temperature>	(gChart,  Thermo1_Chart) 
Number   Thermo1_Temperature_Max         "Temperature Max [%.1f °C]"  <temperature>	(gChart, Thermo1_Chart)

I can see rrd files generated for the items separately, but nothing for the group:

[08:51:30] openhabian@openhab:/var/lib/openhab2/persistence/rrd4j$ ls -lrt Th*
-rw-rw-r-- 1 openhab openhab 28280 Apr 10 08:51 Thermo3_Temperature_Max.rrd
-rw-rw-r-- 1 openhab openhab 28280 Apr 10 08:51 Thermo2_Temperature_Max.rrd
-rw-rw-r-- 1 openhab openhab 28280 Apr 10 08:51 Thermo1_Temperature_Min.rrd
-rw-rw-r-- 1 openhab openhab 28280 Apr 10 08:51 Thermo1_Temperature.rrd
-rw-rw-r-- 1 openhab openhab 28280 Apr 10 08:51 Thermo2_Temperature.rrd
-rw-rw-r-- 1 openhab openhab 28280 Apr 10 08:51 Thermo2_Temperature_Min.rrd
-rw-rw-r-- 1 openhab openhab 28280 Apr 10 08:51 Thermo3_Temperature_Min.rrd
-rw-rw-r-- 1 openhab openhab 28280 Apr 10 08:51 Thermo3_Temperature.rrd
-rw-rw-r-- 1 openhab openhab 28280 Apr 10 08:51 Thermo1_Temperature_Max.rrd

Any idea ?
Thanks

Have you read this:
When charting a group of item, make sure that every label is unique. If the label contains spaces, the first word of the label must be unique. Identical labels result in an empty chart
You can find it in the chart section of the sitemap documentation.

Yes, I checked that (my config has already worked on a previous install)

Now I can see in log :

2020-04-10 09:07:36.514 [ERROR] [4j.internal.charts.RRD4jChartServlet] - Error generating graph: {}

java.io.FileNotFoundException: Could not open /var/lib/openhab2/persistence/rrd4j/Thermo1_Chart.rrd [non existent]

	at org.rrd4j.core.RrdDb.<init>(RrdDb.java:268) ~[rrd4j-3.3.1.jar:?]

	at org.rrd4j.core.RrdDb.<init>(RrdDb.java:204) ~[rrd4j-3.3.1.jar:?]

	at org.rrd4j.core.RrdDb.<init>(RrdDb.java:184) ~[rrd4j-3.3.1.jar:?]

	at org.rrd4j.data.DataProcessor.getRrd(DataProcessor.java:865) ~[rrd4j-3.3.1.jar:?]

	at org.rrd4j.data.DataProcessor.fetchRrdData(DataProcessor.java:762) ~[rrd4j-3.3.1.jar:?]

	at org.rrd4j.data.DataProcessor.processData(DataProcessor.java:611) ~[rrd4j-3.3.1.jar:?]

	at org.rrd4j.graph.RrdGraph.fetchData(RrdGraph.java:611) ~[rrd4j-3.3.1.jar:?]

	at org.rrd4j.graph.RrdGraph.createGraph(RrdGraph.java:70) ~[rrd4j-3.3.1.jar:?]

	at org.rrd4j.graph.RrdGraph.<init>(RrdGraph.java:49) ~[rrd4j-3.3.1.jar:?]

and if I “touch” the file, it ends with:

2020-04-10 09:09:37.452 [ERROR] [4j.internal.charts.RRD4jChartServlet] - Error generating graph: {}

java.io.IOException: Read failed, file /var/lib/openhab2/persistence/rrd4j/Thermo1_Chart.rrd not mapped for I/O

but I can render with : http://openhab:8080/rrdchart.png?groups=Thermo1_Chart&period=h

just doesn’t display in sitemap

Just to be clear, here is what I have now, first frame doesn’t render, second frame works fine:

			Frame {
				Switch item=Thermo1_Chart_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week", 3="Month", 4="Year"]
				Chart item=Thermo1_Chart period=h refresh=600 visibility=[Thermo1_Chart_Period==0, Thermo1_Chart_Period=="Uninitialized"]
				Chart item=Thermo1_Chart period=D refresh=3600 visibility=[Thermo1_Chart_Period==1]
				Chart item=Thermo1_Chart period=W refresh=3600 visibility=[Thermo1_Chart_Period==2]
				Chart item=Thermo1_Chart period=M refresh=3600 visibility=[Thermo1_Chart_Period==3]
				Chart item=Thermo1_Chart period=Y refresh=3600 visibility=[Thermo1_Chart_Period==4]
			}

			Frame {
				Image refresh=60000 url="http://openhab:8080/rrdchart.png?groups=Thermo1_Chart&period=h" visibility=[Thermo1_Chart_Period==0, Thermo1_Chart_Period=="Uninitialized"]
				Image refresh=60000 url="http://openhab:8080/rrdchart.png?groups=Thermo1_Chart&period=D" visibility=[Thermo1_Chart_Period==1]
				Image refresh=60000 url="http://openhab:8080/rrdchart.png?groups=Thermo1_Chart&period=W" visibility=[Thermo1_Chart_Period==2]
				Image refresh=60000 url="http://openhab:8080/rrdchart.png?groups=Thermo1_Chart&period=M" visibility=[Thermo1_Chart_Period==3]
				Image refresh=60000 url="http://openhab:8080/rrdchart.png?groups=Thermo1_Chart&period=Y" visibility=[Thermo1_Chart_Period==4]
			}

Why are you persisting the group at all? In my setup that is the only difference to yours and my charts are working with groups.
Additionally it looks like the above statement from the documentation isn’t valid anymore.

Edit:
I misread your first post, you are not persisting the group! In this case I see no difference to my setup!
Which openHAB are you on?

Which file did you “touch”?

-rw-rw-r-- 1 openhab openhab 0 Apr 10 09:09 Thermo1_Chart.rrd

but didn’t help, so I removed it.

Looks by it, sitemap tries to render it as an item, not as a group (and I can’t use group(s) in sitemap)

OK, so you have that file. Does it work without it?
My seup:

Frame label="Preisverlauf"  {
            Chart item=gE10 period=D legend=true refresh=300000 visibility=[ChartSelector==0, ChartSelector=="NULL"]

gE10 is group of 3 items.
Resulting in:

no, doesn’t work with it and doesn’t work without it.

As said above, I can render in direct, using the group, but not with the item

I’m on openHABian, that is latest version of openHAB (2.5)

Sorry, no further idea.
I’m on openHAB 2.5.1-2 release build also running on a openhabian installation.

What is your default persistence service? Is it set to rrd4j?

There would be no reason for the charting app to try to retrieve your Group from the db (as it wouldn’t even be in the db normally). It would need to know the members, and retrieve those.

That would suggest the charting app is having difficulty recognising that this is a Group type Item.

In fact, I checked back my config seeing the notification about persisting the group… And indeed, in one of my setup (but not the 3 others) the group was persisted… I removed it and it unlocked all 4 thermometers… Now, everything get graphed

Thanks for that

1 Like