[SOLVED] Graphs with RRD4J

One last question, I have a visual problem with the time periods of the graphics.

1- In the app I get all the graphics followed one below the other and although press the buttons (hour, week …) nothing happens since they are displayed all at the same time.

2- If I access by browser, all the graphics also appear one below the other but the time buttons do not appear

Hi,
I think you’ve got some errors with the mapping of the Switch in your sitemap
You shouldn’t see the switch visible on your browser screenshot.

nothing happens since they are displayed all at the same time.

What do you mean exactly? In the browser, you’d need to reload the page
The above code should give you sth like this, else you’re not persisting a group:

BTW, if someone reads this who can answer: Is there a way to clear the wrong data entry out of the RRD4J DB? (on 20th december one of my sensors recorded a temperature of 9999 °C, making the graph unreadable).

Here are some other periods you may try as well:


„h“ – 1 hour,
„4h“ – 4 hour,
„12h“ – 12 hour,
„D“ – 1 day,
„3D“ – 3 days,
„W“ – 1 week,
„2W“ – 2 weeks,
„M“ – 1 monht,
„2M“ – 2 Month
„4M“ – 4 Months
„Y“ – 1 Year.

Ok, the problem was that he had not defined the item, IntervallTempus :sweat:
Now, i have one graph, but to see another period of time I must press the button and refresh the page to change the graph, is it normal?
Regarding the graphic, for the moment it only records the value of kwh of a single room, so only one line comes out, in the future I will add more

he problem was that he had not defined the item

Cool that you found the issue!

I must press the button and refresh the page to change the graph, is it normal?

Not sure if this is normal, but I have the same when I’m using the browser (Chrome).
in the mobile app, it’s automatically refreshing.

Kurt

Check your browser autorefresh settings. It works for some browsers but I can’t remember which…

No problem, the app works perfectly.

Thanks for all, i come from a veralite, the beginnings with openhab are a little hard but it is an incredible platform.

Big Community, Big, people, Big software :muscle:

I know the original problem has been solved.
But I see you´re suffering from the same as I with RRD4J is persisting value numbers with several decimals.

This is a snip from the tail log of one of my temperature sensores:

2018-05-29 22:50:14.817 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.60 to 26.50
2018-05-29 22:50:20.149 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.50 to 26.60
2018-05-29 22:51:29.810 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.60 to 26.50
2018-05-29 22:51:35.181 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.50 to 26.60
2018-05-29 22:52:55.505 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.60 to 26.50
2018-05-29 22:53:06.210 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.50 to 26.60
2018-05-29 22:53:11.672 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.60 to 26.50
2018-05-29 23:11:03.208 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.50 to 26.40
2018-05-29 23:11:08.554 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.40 to 26.50
2018-05-29 23:11:13.888 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.50 to 26.40
2018-05-29 23:11:19.371 [vent.ItemStateChangedEvent] - stort_bad_Temperature changed from 26.40 to 26.50

This is a screendump from BasicUI

I wonder why rrd4j persists 2 decimals. I have even seen charts with 3 decimals. Any idea why? I just want 1 decimal, and thats it. I have set up once decimal in my items as well. But rrd4j seem to live on its own.

Also please note the temeprature readings in oppe right place on the screendump saying 26.5 degrees. Yet rrd4j persist 26.6.

Any ideas why?

This is the persisting file:

Strategies {
 everyMinute : "0 * * * * ?"
 everyHour : "0 0 * * * ?"
 everyDay : "0 0 0 * * ?"
 every15min : "*/15 * * * * ?"
 default = everyChange
}

Items {
Temperatur* : strategy = restoreOnStartup, everyChange 
Fugtighed* : strategy = restoreOnStartup, everyChange }

And this is the sitemap

sitemap stortbad label="Stort Bad"
{
	Frame label="Lys" {
		Switch item=stort_bad_OEH label="Halogenlys" mappings=[ON=Kip]
		Text item=stort_bad_halogenlys label="Halogenlys"

	}

	Frame label="Fugt, Varme & Ventilation" {
		Text item=stort_bad_fugt label="Relativ Fugtighed"
		Text item=stort_bad_Temperature label="Temperatur"
			Setpoint item=stort_bad_Tempsetpunkt minValue=18 maxValue=25 step=0.1 label="Juster varmen"
		Text item=telestat1_stort_bad label="Telestat"

Switch item=IntervallTempus label="Vælg Periode" mappings=[0="Hour", 1="Day", 2="Week", 3="Month", 4="Year"]
Chart item=stort_bad_Temperature period=h refresh=30000 visibility=[IntervallTempus==0, IntervallTempus=="Uninitialized"]
Chart item=stort_bad_Temperature period=D refresh=30000 visibility=[IntervallTempus==1]
Chart item=stort_bad_Temperature period=W refresh=30000 visibility=[IntervallTempus==2]
Chart item=stort_bad_Temperature period=M refresh=30000 visibility=[IntervallTempus==3]
Chart item=stort_bad_Temperature period=Y refresh=30000 visibility=[IntervallTempus==4]

Chart item=stort_bad_fugt period=h refresh=30000 visibility=[IntervallTempus==0, IntervallTempus=="Uninitialized"]
Chart item=stort_bad_fugt period=D refresh=30000 visibility=[IntervallTempus==1]
Chart item=stort_bad_fugt period=W refresh=30000 visibility=[IntervallTempus==2]
Chart item=stort_bad_fugt period=M refresh=30000 visibility=[IntervallTempus==3]
Chart item=stort_bad_fugt period=Y refresh=30000 visibility=[IntervallTempus==4]



	}

	Frame label="Ventilation" {
		Switch item=stort_bad_NV label="Tænd ventilation i 15 min" mappings=[ON=Kip]
		Text item=Nilan_Output_UserFunc
		Text item=nilan_output_ExhaustSpeed
		Text item=nilan_output_InletSpeed
	}
}

And the items:

//Stort Bad
Number stort_bad_Temperature "Temperatur stort bad [%.1f °C]" <cu_heating> (Temperatur) [ "CurrentTemperature" ] {ihc="13699860"}
Number stort_bad_Tempsetpunkt "Temperature setpunkt  [%.1f °C]" <temperature> {ihc="7989780"}
Number stort_bad_fugt "Fugtighed stort bad [%.1f %%]" <Humidity> (Fugtighed) ["TargetHumidity"] {ihc="13699623"}

You item is setup to SHOW only one decimal digit ( %.1f), rrd4j does store the whole value.
did you ever check which correct value is stored (my gues for the actual value is something like 26.59999.

Honestly, I have no idea how to check this.
The temperature readings is read from my IHC controller, (Intelligent House Controle), which is showing 2 decimal digits as well. So I just assumed this was the case with OpenHab as well, as it (trail log) shows 2 decimal digits as well, (where 0 (zero) is the second).

My itmes are set to show only one, which make this even more suspect, cause Trail log shows two…

I really can´t figure this decimal digits :frowning:

@rabeliyo
Was your conclusion that rrd4j won’t work on a windows openhab server?

I’ve got the same problem. Tried all solutions I read on several topics but no result.

Willem

Asking for some input on this - want to graph by day on Covid-19 data. The data is whole numbers which is defined as a Number in the item file.

	// Persist Covid19
	CoronaUS*	 : strategy = everyDay, restoreOnStartup
	CoronaUS_IL* : strategy = everyDay, restoreOnStartup

My question is what do I put for the archive options below in the rrd4j.cfg?

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

Best, Jay

From the rrd4j docs

IMPORTANT

The strategy everyMinute (60 seconds) MUST be used, otherwise no data will be persisted (stored). Other strategies can be used too.

I do not know if you can tune the archives better from default for this particular use-case, probably.

This is done but I’m still confused on the archive logic; I’m not seeing anything about daily archiving. All archive examples are around minutes or hour logic.

	// Persist Covid19
	CoronaUS*	 : strategy = everyMinute, everyDay, restoreOnStartup
	CoronaUS_IL* : strategy = everyMinute, everyDay, restoreOnStartup

Best, Jay

I don’t think rrd4j works like that. You define each archive as a number of “boxes” and define the size/duraton of each box in minutes. Boxes x size = size or duration of archive. Each archive “starts” in history where the previous one finishes.

I think that isn’t correct, IMHO each archive ends at now, the beginning is computed by steps times rows.
I’m on the road now, will post my custom archive setting for daily values (I do save a value each minute).

Edit

TempLogger2.def=GAUGE,90,U,U,60
TempLogger2.archives=LAST,.5,1,1440:LAST,.5,1440,732
TempLogger2.items=Burner_Hours,Burner_Starts
1 Like

Makes sense. I had start/end terms swapped as well! Always brain ache with this stuff.