[SOLVED] Problems with RRD4J config

Hi,

I would be greatful if someone could help me configuring RRD4J persistence to get graphs about temperature and humidity.

My sitemap

>     sitemap local label="openHAB" {
>         Frame label="piDOMOhome" {
>             
> 
>             Default item=Motion label="moviment"
>     		
>     		Switch item=Light label="llum"
>             
>             Default item=Temperature label="temperature"
>             
>             Default item=Humidity label="humidity"
>     		
>     		Default item=Luminosity label="luminosity"
>     		
>     		Default item=Fire label="fire"
>     		
>     		Default item=Flood label="water"
>     		
>     		
>         }
>     	
>     	    Frame label="Temperature graph" {
>             Chart item=gTemperature label="test" period=W refresh=1000
>         }
> 
>         	    Frame label="Himidity graph" {
>             Chart item=gHumidity label="test" period=W refresh=1000
> 
>         }
>         
>     }

persistence\rrd4j.persist

> Strategies {
>     // for rrd charts, we need a cron strategy, every Minute is a must have.
>     everyMinute : "0 * * * * ?"
>     // get the data reduced for older values to keep database small
>     everyHour : "0 0 * * * ?"
>     everyDay : "0 0 0 * * ?"
> 
>     default = everyChange
> }
> 
> Items {
>     // additionally persist Items
>     gTemperature : strategy = everyMinute
>     gHumidity : strategy = everyMinute
> 
> }

services\rrd4j.cfg

> # configure specific rrd properties for given items in this file.
> # please refer to the documentation available at
> # https://www.openhab.org/addons/persistence/rrd4j/
> #
> # 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=<comma separated list of items for this defname> 
> <defname>.items=gTemperature,gHumidity

I don’t have more files. RRD4J for default persistence on config.

1 Like

What doesn’t work?

gTemperature : strategy = everyMinute
You are aware that you are persisting the state of the Item gTemperature?
If that is a group Item, this won’t store the state of any member Items.
If that is a group Item, it won’t have a state unless you have specified a type and an aggregation function in its Item definition.

To elaborate or @rossko57’s answer,
gTemperature : strategy = everyMinute will only persist the group item
gTemperature* : strategy = everyMinute will persist the members of the group

See:

1 Like

Hi,

Thank you very much @rossko57 and @vzorglub
Now it works, but I have another problem. I had two graphs working and when added luminosity to the rrd4j my sitemap disappeared. I explain it here: My sitemap has disappeared

rrd4j.cfg

# configure specific rrd properties for given items in this file.
# please refer to the documentation available at
# https://www.openhab.org/addons/persistence/rrd4j/
#
# 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=<comma separated list of items for this defname> 
<defname>.items=Temperature,Humidity,Luminosity

rrd4j.persist
Strategies {
// for rrd charts, we need a cron strategy, every Minute is a must have.
everyMinute : “0 * * * * ?”
// get the data reduced for older values to keep database small
everyHour : “0 0 * * * ?”
everyDay : “0 0 0 * * ?”

default = everyChange

}

Items {
// additionally persist Items
gTemperature* : strategy = everyMinute
gHumidity* : strategy = everyMinute
gLuminosity* : strategy = everyMinute

}

Thanks a lot,
Josep

Hi,

I have another question. I have edited my rrd4j.persist as…

Strategies {
    // for rrd charts, we need a cron strategy, every Minute is a must have.
    everyMinute : "0 * * * * ?"
    // get the data reduced for older values to keep database small
    everyHour : "0 0 * * * ?"
    everyDay : "0 0 0 * * ?"

    default = everyChange
}

Items {
    // additionally persist Items
    gTemperature* : strategy = everyMinute
    gHumidity* : strategy = everyMinute
    gLuminosity* : strategy = everyMinute

}

and my rrd4j.cfg

# configure specific rrd properties for given items in this file.
# please refer to the documentation available at
# https://www.openhab.org/addons/persistence/rrd4j/
#
# 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=<comma separated list of items for this defname> 
<defname>.items=Temperature,Humidity,Luminosity

My local.items is…

Group     Home                 "piDOMOhome"               <house>

Group     piDOMOhome               "TDR"                <pantry>        (Home)

Switch    Light         "Luz"                    <light>         (piDOMOhome, gLight)         ["Lighting"]     {mqtt=">[mqtt:piDOMOhome/light:command:ON:1],>[mqtt:piDOMOhome/light:command:OFF:0],<[mqtt:piDOMOhome/light:state:ON:1],<[mqtt:piDOMOhome/light:state:OFF:0]"}
Contact   Door          "Porta [%s]"                 <door>          (piDOMOhome, gDoor)                           {mqtt="<[mqtt:piDOMOhome/door:state:default]"}
Contact   Motion        "Sensor de moviment[%s]"   <motion>        (piDOMOhome, gMotion)                         {mqtt="<[mqtt:piDOMOhome/movement:state:default]"}


Switch    MotionTrig        "Trigger"                	<switch>   		(piDOMOhome, gMotion)         ["Switchable"]   {mqtt=">[mqtt:piDOMOhome/trigger:command:ON:1],>[mqtt:piDOMOhome/trigger:command:OFF:0],<[mqtt:piDOMOhome/trigger:state:ON:1],<[mqtt:piDOMOhome/trigger:state:OFF:0]"}


Number    Temperature   "Temperatura [%.1f ÂşC]"            <temperature>   (piDOMOhome, gTemperature)                    {mqtt="<[mqtt:piDOMOhome/temperature:state:default]"}
Number    Humidity      "Humitat [%.1f %%]"                <humidity>      (piDOMOhome, gHumidity)                       {mqtt="<[mqtt:piDOMOhome/humidity:state:default]"}
Number    Luminosity      "Lluminositat [%.0f %%]"                <light>      (piDOMOhome, gLuminosity)                       {mqtt="<[mqtt:piDOMOhome/luminosity:state:default]"}


Contact   Fire        "Sensor de foc[%s]"   <fire>        (piDOMOhome, gMotion)                         {mqtt="<[mqtt:piDOMOhome/fire:state:default]"}
Switch	  Alarm		"Alarma"	(gAlarm) {mqtt=">[mqtt:piDOMOhome/alarm:command:ON:1],>[mqtt:piDOMOhome/alarm:command:OFF:0],<[mqtt:piDOMOhome/alarm:state:ON:1],<[mqtt:piDOMOhome/alarm:state:OFF:0]"}
Contact   Flood        "Sensor d'aigua[MAP(flood.map):%s]"   <water>        (piDOMOhome, gWater)                         {mqtt="<[mqtt:piDOMOhome/flood:state:default]"}
Switch    Servo         "Servo Porta"                <door>   (piDOMOhome, gMotion)         ["Switchable"]   {mqtt=">[mqtt:piDOMOhome/servo:command:ON:1],>[mqtt:piDOMOhome/servo:command:OFF:0],<[mqtt:piDOMOhome/servo:state:ON:1],<[mqtt:piDOMOhome/servo:state:OFF:0]"}

Group:Switch:OR(ON, OFF)         gLight         "Luz"                    <light>         (Home)
Group:Contact:OR(OPEN, CLOSED)   gMotion          "Porta"                 <door>          (Home)
Group:Contact:OR(OPEN, CLOSED)   gMotion        "Sensor de moviment"   <motion>        (Home)
Group:Switch:OR(ON, OFF)         gMotion         "Trigger"                <motion>   	(Home)
Group:Number:AVG                 gTemperature   "Temperatura"            <temperature>   (Home)
Group:Number:AVG                 gHumidity      "Humitat"                <humidity>      (Home)
Group:Number:AVG                 gLuminosity      "Lluminositat"                <luminosity>      (Home)
Group:Contact:OR(OPEN, CLOSED)   gMotion        "Sensor de foc"   		<motion>        (Home)
Group:Switch:OR(ON, OFF)	gMotion				"Alarma"				<motion>		(Home)
Group:Contact:OR(OPEN, CLOSED)   gMotion          "Servo Porta"                 <door>          (Home)

My local.sitemap

sitemap local label="piDOMOhome" {
    Frame label="Casa domòtica" {
        
        Switch item=MotionTrig label="ActivaciĂł alarma"
		
		Switch item=Alarm label="Notificacions"
		
		Default item=Door label="Porta"

        Default item=Motion label="Moviment"
		
		Switch item=Servo label="Motor"
		
		Switch item=Light label="Llum"
        
        Default item=Temperature label="Temperatura"
        
        Default item=Humidity label="Humitat"
		
		Default item=Luminosity label="Lluminositat"
		
		Default item=Incendi label="Incendi"
		
		Default item=Aigua label="Sensor d'inundaciĂł"
		
		
    }
	
	    Frame label="GrĂ fic temperatura" {
        Chart item=Temperature label="temperature_graph" period=W refresh=1000
    }

    	    Frame label="GrĂ fic humitat" {
        Chart item=Humidity label="humidity_graph" period=W refresh=1000

    }


    	    Frame label="GrĂ fic lluminositat" {
        Chart item=Luminosity label="luminosity_graph" period=W refresh=1000

    }
    
}

Humidity and temperature graphs are shown on my Basic UI, but luminosity, which I have just added now is shown without any information.

I don’t know if possibily I have to wait or if something is badly configurated.

Then, I would like to know if the data is saved on a database or in a log.

Thank you very much!

Josep


See the picture, first is Temperature, second Humidity and the last, Luminosity…

If you created this item recently and you are looking for a whole week it takes 60 minutes to see the first value. In order to see a graph earlier just try to show one hour only.

Hi!
Now one unique value is shown. As I have been changing the configuration in the rrd4j.persist, between gLuminosity* : strategy = everyMinute and Luminosity : strategy = everyMinute, possibly when it was correct it stored only a value.-
Now I’ve added the two lines, I suppose it is correct (so there’s a group and an item from this group, and I don’t know if it can be bad…

rrd4j.persist

Strategies {
    // for rrd charts, we need a cron strategy, every Minute is a must have.
    everyMinute : "0 * * * * ?"
    // get the data reduced for older values to keep database small
    everyHour : "0 0 * * * ?"
    everyDay : "0 0 0 * * ?"

    default = everyChange
}

Items {
    // additionally persist Items
    gTemperature* : strategy = everyMinute
    gHumidity* : strategy = everyMinute
    gLuminosity* : strategy = everyMinute
    Luminosity : strategy = everyMinute

}

I have several questions:

1.- Is there any solution to refresh the graph?
2.- Where is the data saved? I would like to export it.
3.- Where can I see which graphs are being processed?
4.- Is there any log of this RRD4J persistence?

Thank you very much :slight_smile:

Josep


See the photo:

  1. You did set the refresh of the graph to 1 second ( 1000 millisec). That is way to fast for a graph that shows data for a week and especially for a database that has updates only once an hour ( yes one hour, read the rrd4j documentation in order to understand how the archives are used).
    If you want to see more recent data you have to select a smaller period to be discovered. Selecting “h” for one hour will show the values persisted for every minute.
  2. The data is stored in .rrd files which are to be found in the ${openhab_home}/etc/rrd4j folder or /var/lib/openhab/persistence/rrd4j folder for apt-get installed openHABs.
  3. All correctly configured graphs are “ptocessed”, a failure to do so should show somehow in the logs.
  4. You can raise the log level for this bundle on the karat console, that way each value persisted will log.

Please read the rrd4j documentation in order to understand the specifications of this database, IMHO it is running as planned on your system!

Thank you very much, all is working properly :slight_smile:

Josep

1 Like

If it s working properly for you, could you mark this thread as resolved by clicking the “Solution” icon (see picture) on the post that gave you the solution?

Solution

OK, perfect.

Thanks a lot,

Josep