Temperature and humidity Generation chart failed

Hey there, I want to display a graph that shows temperature and humidity data.
I am using rrd4j.cfg file and I edited my persistence files as shown :

rrd4h.cfg file:

DHT11.def=GAUGE,600,U,U,60
DHT11.archives=AVERAGE,0.5,1,480:AVERAGE,0.5,4,360:AVERAGE,0.5,14,644:AVERAGE,0$
DHT11.items=home_temp

mqtt-persistences.cfg file :

``

Name of the broker as defined in mqtt.cfg

broker=192.168.2.169

The MQTT topic to which the persistence messages should be sent.

topic=temperature

A string representing the persistence message content.

message=%1$s, %3$s

You should be able to manage the rrd4j configs using the defaults. I wouldn’t edit rrd4j.cfg unless you really know what you are doing.

What is your rrd4j.persist file? Did you install the rrd4j addon?

1 Like

That would need to be mqtt-persistence.cfg
But I do not think it does what you think it does; this has nothing to do with graphing, nothing to do with reading data from sensors.
mqtt-persistence is to allow openHAB to publish (never read) Item data to an MQTT broker.

Yes I did install rrd4j

I gotta say that one of the most annoying thing about helping people on this forum is needing to pry out of the those asking for help even the most basic information necessary to provide that help.

If I ask a question, I require the answer to that question before I can proceed. Read my reply again. There are two questions there.

You could probably save us both some time by reviewing How to ask a good question / Help Us Help You.

I have already showed my rrd4j file:

You are missing what I am telling you above.

You should be able to manage the rrd4j configs using the defaults. I wouldn’t edit rrd4j.cfg unless you really know what you are doing.

You should not be editing rrd4j.cfg.

As explained in the docs, you must set up which Items get saved with what strategy in a rrd4j.persist file. That’s why I asked for

What is your rrd4j.persist file?

1 Like

rrd4j.persist file :

Strategies {
        everyMinute : "0 * * * * ?"
        default = everyChange
           }
Items {
home_temp* : strategy = everyChange
      }

The * does not mean what you think it means, perhaps.

You have asked to persist all members of a group called home_temp.
You maybe meant to persist the Item home_temp, or some group that Item is a member of?

Please tell me should I remoove * in the code or what should I do ?

this is my

 File: mqtt.things


Bridge mqtt:broker:mosquitto "MQTT Broker" [ host="192.168.2.169", secure=false$
{
  Thing topic livingroom "Livingroom Things" {
    Channels:
    Type number : temperature "Temperature" [ stateTopic="topicName/temperature$
    Type number : humidity "Humidity" [ stateTopic="topicName/humidity" ]
    Type number : operateur "Operateur" [ stateTopic="topicName/v" ]
  }
}


                   File: mqtt.items


Number  home_temp "temperature smt [%.1f °C]" <temperature> { channel="mqtt:top$
Number  home_humi "humidity smt [%.1f %%]" <humidity> { channel="mqtt:topic:mos$
Number home_ope "ope1 smt" <motion>{ channel="mqtt:topic:mosquitto:livingroom:o$

Please I need to save the data and to display a graph of temperature and humidity.
Thanks in advance.

Your Item home_temp is not a Group type, so you do not want home_temp* in your rrd4j.persist file, because that is a group request.

If you want to store an item in rrd4j, just say so in the .persist file
home_temp : strategy = everyChange

After you have got this simple version working, you might want to come back to change it.
If you have several Items to store - home_temp, home_humi, outside_temp, outside_humi etc. etc.
Put each of those Items in a group in your Item definitions

Group persist_Group "group for rrd4j persisting"
Number  home_temp "temperature smt [%.1f °C]" <temperature> (persist_Group) { channel=...
Number  home_humi "humidity smt [%.1f %%]" <humidity> (persist_Group) { channel=...

Now you alter your rrd4j.persist file
persist_Group* : strategy = everyChange
and this will store every member of the group. This is the special meaning of the * here.

1 Like

for rrd4j it needs to be everyMinute or it won’t work.

home_temp: strategy = everyMinute
3 Likes