I don't see "Stored ... in rrd4j database" in log

Hi,

I have configured RRD4J to store temperature coming from KNX in order to create a chart - but I’m stuck. RRD4J appears to be working as log says it’s started. Also, *.RRD files are created. In the KARAF log I can see lines like:

23:07:51.105 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura2' received command 22.8
23:07:51.208 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura1' received command 24.1

where temperatura1 and temperatura2 are items that I want to store values of. Unfortunately I don’t see any log entries like “Stored … in rrd4j database” - of course I’ve used command log:set DEBUG org.openhab.persistence.rrd4j.

My items:

Number temperatura1 "Temperature [%.1f C]" <temperature> (System_Temperature_Chart) { knx="<(5)9.001:1/0/1" }
Number temperatura2 "Temperature [%.1f C]" <temperature> { knx="<(5)9.001:1/0/2" }
Group  System_Temperature_Chart (System, Charts)
Number System_Temperature_Chart_Period "Periode" (System)
Group  System_Temperature_Chart2 (System, Charts)
Number System_Temperature_Chart_Period2 "Periode" (System)

sitemap extract:

	Frame label="Charts" {
            Switch item=System_Temperature_Chart_Period mappings=[0="1h", 1="4h", 2="8h", 3="12h", 4="24h"]
            Chart  item=temperatura1 period=h   refresh=60 visibility=[System_Temperature_Chart_Period==0, System_Temperature_Chart_Period=="Uninitialized"]
            Chart  item=temperatura1 period=4h  refresh=60 visibility=[System_Temperature_Chart_Period==1]
            Chart  item=temperatura1 period=8h  refresh=60 visibility=[System_Temperature_Chart_Period==2]
            Chart  item=temperatura1 period=12h refresh=60 visibility=[System_Temperature_Chart_Period==3]
            Chart  item=temperatura1 period=D   refresh=60 visibility=[System_Temperature_Chart_Period==4]
        }
	Frame label="Charts2" {
            Switch item=System_Temperature_Chart_Period2 mappings=[0="1h", 1="4h", 2="8h", 3="12h", 4="24h"]
            Chart  item=temperatura2 period=h   refresh=60 visibility=[System_Temperature_Chart_Period2==0, System_Temperature_Chart_Period2=="Uninitialized"]
            Chart  item=temperatura2 period=4h  refresh=60 visibility=[System_Temperature_Chart_Period2==1]
            Chart  item=temperatura2 period=8h  refresh=60 visibility=[System_Temperature_Chart_Period2==2]
            Chart  item=temperatura2 period=12h refresh=60 visibility=[System_Temperature_Chart_Period2==3]
            Chart  item=temperatura2 period=D   refresh=60 visibility=[System_Temperature_Chart_Period2==4]
        }

rrd4j.cfg:
temp.items=temperatura1,temperatura2

and rrd4j.persist:

Strategies {
    everyMinute : "0 * * * * ?"
    everyHour : "0 0 * * * ?"
    everyDay : "0 0 0 * * ?"
    
    default = everyChange
}
Items {
	temperatura1* : strategy = everyUpdate, everyMinute
	temperatura2* : strategy = everyUpdate, everyMinute
}

If I use RRD4J inspector I am not sure what I see, but definately there are no remperature values stored. I can see NaN values for example.

Karaf log is full of entries like:

23:31:52.998 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura2' received command 22.7
23:31:53.100 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura1' received command 24.0
23:31:53.199 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'feedback1' received command 0
23:31:57.996 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura2' received command 22.7
23:31:58.099 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura1' received command 24.0
23:31:58.199 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'feedback1' received command 0
23:32:02.996 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura2' received command 22.7
23:32:03.101 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura1' received command 24.0
23:32:03.200 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'feedback1' received command 0
23:32:07.997 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura2' received command 22.7
23:32:08.100 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura1' received command 24.0

And also I see value of these items on my site, so they’re fine. Any ideas what am I doing wrong?

You probably need:

temperatura1 : strategy = everyUpdate, everyMinute
temperatura2 : strategy = everyUpdate, everyMinute

It didn’t help… still everything looks fine but nothing gets stored.

openhab> log:tail
07:55:33.667 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'knx.items'
07:55:34.361 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'test.sitemap'
07:55:34.711 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at http://192.168.1.100:8080
07:55:34.768 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at https://192.168.1.100:8443
07:55:34.849 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
07:55:34.861 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
07:55:34.891 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
07:55:34.985 [DEBUG] [org.openhab.persistence.rrd4j       ] - BundleEvent STARTING - org.openhab.persistence.rrd4j
07:55:34.986 [DEBUG] [stence.rrd4j.internal.RRD4jActivator] - RRD4j persistence bundle has been started.
07:55:34.986 [DEBUG] [org.openhab.persistence.rrd4j       ] - BundleEvent STARTED - org.openhab.persistence.rrd4j
07:55:34.991 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Created temp = GAUGE heartbeat = 60 min/max = 10.0/40.0 step = 60 2 archives(s) = [ AVERAGE xff = 0.5 steps = 1 rows = 365 AVERAGE xff = 0.5 steps = 7 rows = 300] 2 items(s) = [temperatura1 temperatura2 ]
07:55:34.991 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Created default_other = GAUGE heartbeat = 3600 min/max = NaN/NaN step = 1 6 archives(s) = [ MAX xff = 0.999 steps = 1 rows = 3600 MAX xff = 0.999 steps = 10 rows = 1440 MAX xff = 0.999 steps = 60 rows = 1440 MAX xff = 0.999 steps = 900 rows = 2880 MAX xff = 0.999 steps = 21600 rows = 1460 MAX xff = 0.999 steps = 86400 rows = 3650] 0 items(s) = []
07:55:34.991 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Created default_numeric = GAUGE heartbeat = 60 min/max = NaN/NaN step = 60 6 archives(s) = [ AVERAGE xff = 0.5 steps = 1 rows = 480 AVERAGE xff = 0.5 steps = 4 rows = 360 AVERAGE xff = 0.5 steps = 14 rows = 644 AVERAGE xff = 0.5 steps = 60 rows = 720 AVERAGE xff = 0.5 steps = 720 rows = 730 AVERAGE xff = 0.5 steps = 10080 rows = 520] 0 items(s) = []
07:55:34.991 [DEBUG] [org.openhab.persistence.rrd4j       ] - ServiceEvent REGISTERED - {org.openhab.core.persistence.PersistenceService}={service.pid=org.openhab.rrd4j, temp.archives=AVERAGE,.5,1,365:AVERAGE,0.5,7,300, temp.items=temperatura1,temperatura2, temp.def=GAUGE,60,10,40,60, component.name=org.openhab.persistence.rrd4j, component.id=172, service.id=292, service.bundleid=183, service.scope=bundle} - org.openhab.persistence.rrd4j
07:55:34.995 [DEBUG] [4j.internal.charts.RRD4jChartServlet] - Starting up rrd chart servlet at /rrdchart.png
07:55:34.996 [INFO ] [nx.internal.connection.KNXConnection] - Established connection to KNX bus on 192.168.1.149:3671 in mode TUNNEL.
07:55:34.999 [DEBUG] [org.openhab.persistence.rrd4j       ] - ServiceEvent REGISTERED - {javax.servlet.ServletContext}={osgi.web.symbolicname=org.openhab.persistence.rrd4j, osgi.web.version=1.10.0, osgi.web.contextpath=/, service.id=295, service.bundleid=183, service.scope=singleton} - org.openhab.persistence.rrd4j
07:55:35.000 [DEBUG] [org.openhab.persistence.rrd4j       ] - ServiceEvent REGISTERED - {org.openhab.ui.chart.ChartProvider}={component.name=org.openhab.persistence.rrd4j.chartservlet, component.id=173, service.id=294, service.bundleid=183, service.scope=bundle} - org.openhab.persistence.rrd4j
07:55:35.157 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura2' received command 22.240000000000002
07:55:35.182 [INFO ] [marthome.event.ItemStateChangedEvent] - temperatura2 changed from NULL to 22.240000000000002
07:55:35.254 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'feedback3' received command 1
07:55:35.277 [INFO ] [marthome.event.ItemStateChangedEvent] - feedback3 changed from NULL to 1
07:55:35.358 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura1' received command 23.54
07:55:35.381 [INFO ] [marthome.event.ItemStateChangedEvent] - temperatura1 changed from NULL to 23.54
07:55:35.454 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'feedback2' received command OFF
07:55:35.554 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'feedback1' received command 75
07:55:35.576 [INFO ] [marthome.event.ItemStateChangedEvent] - feedback1 changed from NULL to 75
07:55:40.054 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura2' received command 22.240000000000002
07:55:40.156 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura1' received command 23.54
07:55:40.255 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'feedback1' received command 75
07:55:45.053 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura2' received command 22.240000000000002
07:55:45.155 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'temperatura1' received command 23.54
07:55:45.254 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'feedback1' received command 75
07:55:46.010 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'sterowanie1' received command 77
07:55:46.032 [INFO ] [marthome.event.ItemStateChangedEvent] - sterowanie1 changed from NULL to 77
07:55:46.053 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'feedback1' received command 77
07:55:46.075 [INFO ] [marthome.event.ItemStateChangedEvent] - feedback1 changed from 75 to 77

What is the easiest way to check whether RRD4J is working correctly? What easy test can I perform in order to store some other item not coming from KNX for example?

I’m using the REST API to check if the values are really stored ( install REST Documents).
Having done changes to the setup as has been suggested above migth need to delete the old .rrd files.

Looking at the setup of your rrd4j database makes me wonder, you keep in the first archive 365 entries for every minute (covering 6 houres 5 minutes) and in the second archive 300 entries for every 7 minutes (covering 35 houres). Is that what you want?

Nope, that was not the intention - it’s actually a leftover of multiple experiments along the way while I’ve tried to get it working. Rrd4j apparently remembers last configuration, because if I understand correctly the above, what you see in the debug log is not reflected in drd4j.cfg - is that correct?

Nevertheless I guess this is not the issue, since in the current setup at least some values should be stored, am I right?

That’s correct.
I would stop OH, delete the existing .rrd files and restart OH. IMHO rrd4j should start logging then (keeping fingers crossed).
If that is done we can have a look at the correct archive settings (even if that means deleting the .rrd files again).

Your question concerning the rrd4j.cfg: it should contain the settings for the “temp” database, which is no default.

I did that already, that is after corrections that namraccr suggested - I’ve removed rrd files and restarted OH2. :frowning:

So the last chance is Archive settings as I understand - what should they be?

Please post your complete .cfg file and state what are your storage requirements. For how long do you need the values saved?