Unable to plot chart using RRD4J

Hello,

I would like to ask for help, because I am unable to plot a graph from my sensors.

I use arduino which sends temperature, humidity and air pressure using MQTT. This is working and values are shown.

Items file:

//My ITEMS
Group Sklep		(All)
Group Telocvicna	(All)
Group Temp_chart

Number Temp_telocvicna			"Tělocvična Teplota [%.1f]" 	<Temperature>	(Sklep,Telocvicna,Temp_chart) {mqtt="<[mosquitto:/Temp/:state:default]"}
Number Hum_telocvicna			"Tělocvična Rel. vlhkost [%.1f]"	<Humidity>	(Sklep,Telocvicna) {mqtt="<[mosquitto:/Humidity/:state:default]"}
Number Pressure				"Tlak vzduchu [%.1f hPa]"	<Pressure> (Sklep) {mqtt="<[mosquitto:/Pressure/:state:default]"}

Sitemap file:

//My SITEMAPS
sitemap home label="HT SmartHome" {
		Frame label="Tělocvična"
		{
			Text item=Temp_telocvicna label="Teplota [%.1f °C]"
			Text item=Hum_telocvicna label="Vlhkost [%.1f %%]"
			Text item=Pressure label="Tlak vzduchu [%.1f hPa]"
       		Chart item=Temp_chart period=D refresh=3000 
        }
	}
}

rrd4j.cfg file:

# please note that currently the first archive in each RRD defines the consolidation
# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
# fully supported
#
# default_numeric and default_other are internally defined defnames and are used as
# defaults when no other defname applies

#<defname>.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],<heartbeat>,[<min>|U],[<max>|U],<step>
#<defname>.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],<xff>,<steps>,<rows>
#<defname>.items=<list of items for this defname> 

graph.def=GAUGE,90,0,U,300
graph.archives=AVERAGE,0.5,1,365:AVERAGE,0.5,7,300
graph.items=Temp_telocvicna

Frankly I do not know what I am doing wrong, but result is like this:

  • I have got readings, but graph is empty.

rrd4j is set up as persistence service using Paper UI (configuration>system>persistence)
addon.cfg edited: persistence = rrd4j

I tried to delete rrd file when I tested changes, without luck.
rrd file:

Could you help me, please.

Thank you.

As I see it, you are persiting a single number value(“Temp_telocvicna”), hence only one rrd-file.
However, you are asking for a chart of the whole group (“Temp_chart”), I don’t know if that is the reason for not showing anything, but it is worth a try.

BTW: You are persisting only values for the last 365 minutes in the first archive and 2100 minutes in the second. That isn’t a whole day so far!

[Edit:] You are using a “step” of 300! That is wrong! That way you only take a reading every 5 minutes! My calculation above was on the assumption you do take a reading every minute which is NEEDED by rrd4j!!!

Hello,

thanks for the answer, I already moved further, but bow I still have issues with charts.

  1. I am unable to plot more charts, only Temp_telocvicna works, but nothing other (another temp to the same chart and 2x humidities to another chart).

rrd4j.cfg

//# please note that currently the first archive in each RRD defines the consolidation
//# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
//# fully supported
//#
//# default_numeric and default_other are internally defined defnames and are used as
//# defaults when no other defname applies

//#.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],,[|U],[|U],
//#.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],,,
//#.items=

graph.def=GAUGE,90,0,3,60
graph.archives=MAX,0.5,1,1440:MAX,0.5,15,2668
graph.items=Temp_telocvicna,Temp_out,Hum_telocvicna,Hum_out,Pressure

rrd4j.persist
Strategies {
everyMinute : “0 * * * * ?”
}
Items {
Temp_telocvicna : strategy = everyMinute
Temp_out : strategy = everyMinute
Hum_telocvicna : strategy = everyMinute
Hum_out : strategy = everyMinute
Pressure: strategy = everyMinute
}

home.sitemap
//My SITEMAPS
sitemap home label=“HT SmartHome” {
Frame label=“Tělocvična”
{
Text item=Temp_telocvicna label="Teplota [%.1f °C]"
Text item=Hum_telocvicna label=“Vlhkost [%.1f %%]”
//Switch item=Media_Subwoofer
}
Frame label=“Venkovní počasí”
{
Text item=Temp_out label="Teplota [%.1f °C]"
Text item=Hum_out label="Vlhkost [%.1f %%]"
Text item=Pressure label=“Tlak vzduchu [%.1f hPa]”
}
Frame label=“grafy”
{
Chart item=Temp_chart period=H refresh=3000
Chart item=Hum_chart period=H refresh=3000
}
}

home.items
//toto jsou moje ITEMS
Group Sklep (All)
Group Telocvicna (All)
Group Temp_chart
Group Hum_chart
Group Out

Number Temp_telocvicna “Tělocvična teplota [%.1f]°C” (Sklep,Telocvicna,Temp_chart) {mqtt="<[mosquitto:/Temp/:state:default]"}
Number Hum_telocvicna “Tělocvična rel. vlhkost [%.1f]%” (Sklep,Telocvicna) {mqtt="<[mosquitto:/Humidity/:state:default]"}
Number Pressure “Tlak vzduchu [%.1f]hPa” (Out) {mqtt="<[mosquitto:/Pressure/:state:default]"}
Number Temp_out “Venkovní teplota [%.1f]°C” (Out,Temp_chart) {mqtt="<[mosquitto:/Temp/Out/:state:default]"}
Number Hum_out “Venkovní rel. vlhkost [%.1f]%” (Out,Hum_chart) {mqtt="<[mosquitto:/Humidity/Out/:state:default]"}
//Switch Switch_1 “Vypinac” (Out) {mqtt=">[mosquitto:/Switch/:command:ON:1],>[mosquitto:/Switch/:command:OFF:0]"}

Do you have any suggestions?

Thank you.

If you want twovalues shown in one graph, they need to be in the same group. You have that for the temp but not for the hum values.
Saying that I would expect to see two lines in the temp chart and only one on the hum chart.
Just tested it that way on my system.

Hi,

the problem is that I have only one tem line in the temp chart and zero lines in the hum chart.

You are right, one humidity item was not in the same group as the second one.

Thanks.

Understood the problem, however as of now I can’t see the reason. Did you check the log? There migth be something helpfull in it.

Found the reason why you probably don’t get 2 lines in the temp chart. The label of both items is the same! They need to be different, I remember from somewhere that the starting charactes have to be different, because only he first something chars are used.