- Platform information:
- Hardware: RPi4/4GB/32GB
- OS: Debian Linux
- Java Runtime Environment: OpenJDK Temurin 11
- openHAB version: 3.3.0
- Issue of the topic: RRD4J database ignoring data older than 24h
For some time now I’m trying to figure out an issue with my persistence configuration. I’m logging temperature and humidity data and so far used an SQLite DB. Since I don’t need all data points using RRD4J seemed like a good alternative. However I can’t seem to make the service log more than 24h of data. Every chart I add to my sitemap and also investigating the .rrd files themselves results in the oldest data being exactly 24h old. Running the SQLite version in parallel I get continous readings and have data reaching back over a year now.
Please have a look at my configuration in hopes of finding some kind of error. The following is an excerpt from the log set to debug for the RRD4J logger. Attached farther down are my current configuration files.
20:36:53.517 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'Geckocam_t' as value '26.6' in rrd4j database
20:36:53.522 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae8068569_t' as value '26.097' in rrd4j database
20:36:53.527 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae806d8ab_h' as value '78.72' in rrd4j database
20:36:53.532 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae8068569_h' as value '50.695' in rrd4j database
20:36:53.537 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae807011c_t' as value '24.868' in rrd4j database
20:36:53.543 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae807011c_battery_warn' as value '0.0' in rrd4j database
20:36:53.547 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae8068569_battery_warn' as value '0.0' in rrd4j database
20:36:53.552 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae80687dd_t' as value '25.83' in rrd4j database
20:36:53.558 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae8068634_h' as value '53.52' in rrd4j database
20:36:53.562 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'Geckocam_h' as value '68.0' in rrd4j database
20:36:53.566 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae807011c_h' as value '52.16' in rrd4j database
20:36:53.570 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae8068634_t' as value '25.49' in rrd4j database
20:36:53.575 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae806d8ab_t' as value '25.72' in rrd4j database
20:36:53.581 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae806d8ab_battery_warn' as value '0.0' in rrd4j database
20:36:53.585 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae80687dd_battery_warn' as value '0.0' in rrd4j database
20:36:53.590 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae8068634_battery_warn' as value '0.0' in rrd4j database
20:36:53.594 [DEBUG] [rd4j.internal.RRD4jPersistenceService] - Stored 'S2c3ae80687dd_h' as value '53.904' in rrd4j database
rrd4j.cfg
#one value every 600s
ambient_sensors_t.def=GAUGE,660,U,U,600
#store duration@intervals: 144x600s=24h@10min, 24h@1h, 7d@3h, 30d@24h, 12M@~30d
ambient_sensors_t.archives=LAST,0.9,1,144:AVERAGE,0.9,6,24:AVERAGE,0.9,18,56:AVERAGE,0.9,144,30:AVERAGE,0.9,4380,12
ambient_sensors_t.items=S2c3ae806d8ab_t,S2c3ae80687dd_t,S2c3ae8068634_t,S2c3ae8068569_t,Geckocam_t,S2c3ae807011c_t
ambient_sensors_h.def=GAUGE,660,U,U,600
ambient_sensors_h.archives=LAST,0.9,1,144:AVERAGE,0.9,6,24:AVERAGE,0.9,18,56:AVERAGE,0.9,144,30:AVERAGE,0.9,4380,12
ambient_sensors_h.items=S2c3ae806d8ab_h,S2c3ae80687dd_h,S2c3ae8068634_h,S2c3ae8068569_h,Geckocam_h,S2c3ae807011c_h
rrd4j.persist
Strategies {
//cron expression "sec min h dom m dow"
everyNinthMinute : "* 0/9 * * * ?"
}
Items {
gAmbientSensorPersist* : strategy = everyNinthMinute, restoreOnStartup
}
sensors.items
Group gAmbientSensor "Umgebungssensoren"
Group gAmbientSensorPersist
Group gAmbientSensorTemp
Group gAmbientSensorHumid
Group gAmbientSensorProxies
Group gAmbientSensorBatteryWarn
Group gAmbientSensorBatteryUpdate
Group gThermostatBath "Thermostat Bad" {ga="Thermostat", alexa="Thermostat"}
Group gThermostatKitchen "Thermostat Kueche" {ga="Thermostat", alexa="Thermostat"}
Group gThermostatSleep "Thermostat SchlaZi" {ga="Thermostat", alexa="Thermostat"}
Group gThermostatLiving "Thermostat WoZi" {ga="Thermostat", alexa="Thermostat"}
Group gThermostatChild "Thermostat KiZi" {ga="Thermostat", alexa="Thermostat"}
Number S2c3ae806d8ab_t "Bad T [%.1f]" (gAmbientSensor, gAmbientSensorTemp, gAmbientSensorPersist, gThermostatBath) {ga="thermostatTemperatureAmbient", alexa="CurrentTemperature"}
Number S2c3ae806d8ab_t_proxy "Bad T Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae806d8ab:temperature"}
Number S2c3ae806d8ab_h "Bad H [%.1f]" (gAmbientSensor, gAmbientSensorHumid, gAmbientSensorPersist, gThermostatBath) {ga="thermostatHumidityAmbient", alexa="CurrentHumidity"}
Number S2c3ae806d8ab_h_proxy "Bad H Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae806d8ab:humidity"}
DateTime S2c3ae806d8ab_last_update "Bad letztes Update [%1$tA %1$td.%1$tm. %1$tT]" (gAmbientSensor, gAmbientSensorBatteryUpdate)
Switch S2c3ae806d8ab_battery_warn "Bad Batteriewarnung" (gAmbientSensor, gAmbientSensorPersist, gAmbientSensorBatteryWarn)
Number S2c3ae8068634_t "Küche T [%.1f]" (gAmbientSensor, gAmbientSensorTemp, gAmbientSensorPersist, gThermostatKitchen) {ga="thermostatTemperatureAmbient", alexa="CurrentTemperature"}
Number S2c3ae8068634_t_proxy "Küche T Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae8068634:temperature"}
Number S2c3ae8068634_h "Küche H [%.1f]" (gAmbientSensor, gAmbientSensorHumid, gAmbientSensorPersist, gThermostatKitchen) {ga="thermostatHumidityAmbient", alexa="CurrentHumidity"}
Number S2c3ae8068634_h_proxy "Küche H Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae8068634:humidity"}
DateTime S2c3ae8068634_last_update "Küche letztes Update [%1$tA %1$td.%1$tm. %1$tT]" (gAmbientSensor, gAmbientSensorBatteryUpdate)
Switch S2c3ae8068634_battery_warn "Küche Batteriewarnung" (gAmbientSensor, gAmbientSensorPersist, gAmbientSensorBatteryWarn)
Number S2c3ae8068569_t "SchlaZi T [%.1f]" (gAmbientSensor, gAmbientSensorTemp, gAmbientSensorPersist, gThermostatSleep) {ga="thermostatTemperatureAmbient", alexa="CurrentTemperature"}
Number S2c3ae8068569_t_proxy "SchlaZi T Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae8068569:temperature"}
Number S2c3ae8068569_h "SchlaZi H [%.1f]" (gAmbientSensor, gAmbientSensorHumid, gAmbientSensorPersist, gThermostatSleep) {ga="thermostatHumidityAmbient", alexa="CurrentHumidity"}
Number S2c3ae8068569_h_proxy "SchlaZi H Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae8068569:humidity"}
DateTime S2c3ae8068569_last_update "SchlaZi letztes Update [%1$tA %1$td.%1$tm. %1$tT]" (gAmbientSensor, gAmbientSensorBatteryUpdate)
Switch S2c3ae8068569_battery_warn "SchlaZi Batteriewarnung" (gAmbientSensor, gAmbientSensorPersist, gAmbientSensorBatteryWarn)
Number S2c3ae807011c_t "WoZi T [%.1f]" (gAmbientSensor, gAmbientSensorTemp, gAmbientSensorPersist, gThermostatLiving) {ga="thermostatTemperatureAmbient", alexa="CurrentTemperature"}
Number S2c3ae807011c_t_proxy "WoZi T Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae807011c:temperature"}
Number S2c3ae807011c_h "WoZi H [%.1f]" (gAmbientSensor, gAmbientSensorHumid, gAmbientSensorPersist, gThermostatLiving) {ga="thermostatHumidityAmbient", alexa="CurrentHumidity"}
Number S2c3ae807011c_h_proxy "WoZi H Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae807011c:humidity"}
DateTime S2c3ae807011c_last_update "WoZi letztes Update [%1$tA %1$td.%1$tm. %1$tT]" (gAmbientSensor, gAmbientSensorBatteryUpdate)
Switch S2c3ae807011c_battery_warn "WoZi Batteriewarnung" (gAmbientSensor, gAmbientSensorPersist, gAmbientSensorBatteryWarn)
Number S2c3ae80687dd_t "KiZi T [%.1f]" (gAmbientSensor, gAmbientSensorTemp, gAmbientSensorPersist, gThermostatChild) {ga="thermostatTemperatureAmbient", alexa="CurrentTemperature"}
Number S2c3ae80687dd_t_proxy "KiZi T Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae80687dd:temperature"}
Number S2c3ae80687dd_h "KiZi H [%.1f]" (gAmbientSensor, gAmbientSensorHumid, gAmbientSensorPersist, gThermostatChild) {ga="thermostatHumidityAmbient", alexa="CurrentHumidity"}
Number S2c3ae80687dd_h_proxy "KiZi H Proxy [%.1f]" (gAmbientSensor, gAmbientSensorProxies) {channel="mqtt:topic:S2c3ae80687dd:humidity"}
DateTime S2c3ae80687dd_last_update "KiZi letztes Update [%1$tA %1$td.%1$tm. %1$tT]" (gAmbientSensor, gAmbientSensorBatteryUpdate)
Switch S2c3ae80687dd_battery_warn "KiZi Batteriewarnung" (gAmbientSensor, gAmbientSensorPersist, gAmbientSensorBatteryWarn)
my.sitemap
sitemap my label="OpenHAB" {
Frame label="RRD4J" icon=line
{
Chart item=gAmbientSensorTemp label="1h" refresh=30000 period=h legend=true service="rrd4j"
Chart item=gAmbientSensorTemp label="4h" refresh=30000 period=4h legend=true service="rrd4j"
Chart item=gAmbientSensorTemp label="1D" refresh=30000 period=D legend=true service="rrd4j"
Chart item=gAmbientSensorTemp label="2D" refresh=30000 period=2D legend=true service="rrd4j"
Chart item=gAmbientSensorTemp label="3D" refresh=30000 period=3D legend=true service="rrd4j"
Chart item=gAmbientSensorTemp label="1M" refresh=30000 period=M legend=true service="rrd4j"
}
}