Problem: Chart generation failed: null

hi, i need help
I am using rrd4j:
1- paiper UI>add-ons>persistances>install rrdj4
2- paiper UI>configuration>system>persistence>rrdj4(Default Service)
3- :etc/openhab2/things: mqtt.things file :

Bridge mqtt:broker:mosquitto "MQTT Broker" [ host="192.168.2.169", secure=false, username="", password="", clientID="openHAB2" ]
{
  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" ]
  }
}

4- :etc/openhab2/items: mqtt.items file :


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

5- etc/openhab2/sitemaps: mqtt.sitemap file :

sitemap mqtt label="DPI"
{
        Frame label="Temperature"
        {
                Text item=home_temp
                Text item=home_humi
                Text item=home_ope
        }
        Frame label="Temperature"
        {
         Chart item=home_temp  period=h refresh=30
         }
}

6- etc/openhab2/persistence: rrd4j.persist file :

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

Items {
home_temp : strategy = everyUpdate, everyMinute
      }

7-etc/openhab2/services: rrd4j.cfg file :

# 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

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.5,60,720:AVERAGE,0.5,720,730:AVERAGE,0.5,10080,520
DHT11.items=home_temp

mqtt-persistence.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=topicName/temperature

# A string representing the persistence message content.
message=%1$s, %3$s

8- the problem : :’(
2019-05-28 22:14:50.235 [WARN ] [thome.ui.internal.chart.ChartServlet] - Chart generation failed: null

The MQTT persistence is an odd thing to do, but not relevant here.

Do you see the Item getting updates in events.log ?

Does REST API show values being stored in rrd4j ?

There’s an example of using REST API to check if Item persisted here

when i open the hom_temp.rrd file i found
/var/lib/openhab2/persistence/rrd4j: home_temp.rrd file:

I don’t care. Can you read it with REST API, because that’s essentially what chart needs to do.

sorry I can not get to understand you i find On the welcome screen of openHAB, i see a interface called “REST API” where i can easily see the documentation of the REST API , i found:

That’s it. Find persistence. click Show. click GET … {itemname). fill in the item name box. press Try it Out button.

First Thank you for your responds
I did the instructions you showed me but it doesn’t work yet please chech the code:

1- Curl :

curl -X GET --header "Accept: application/json" "http://192.168.2.169:8080/rest/persistence/items/home_temp"

2- Request URL :

http://192.168.2.169:8080/rest/persistence/items/home_temp

3- Response Body:

{
  "name": "home_temp",
  "datapoints": "68",
  "data": [
    {
      "time": 1559009760000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559010600000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559011440000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559012280000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559013120000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559013960000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559014800000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559015640000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559016480000,
      "state": "30.45"
    },
    {
      "time": 1559017320000,
      "state": "31.77857142857142"
    },
    {
      "time": 1559018160000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559019000000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559019840000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559020680000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559021520000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559022360000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559023200000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559024040000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559024880000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559025720000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559026560000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559027400000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559028240000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559029080000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559029920000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559030760000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559061000000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559061840000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559062680000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559063520000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559064360000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559065200000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559066040000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559066880000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559067720000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559068560000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559069400000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559070240000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559071080000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559071920000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559072760000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559073600000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559074440000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559075280000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559076120000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559076960000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559077800000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559078640000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559079480000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559080320000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559081160000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559082000000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559082840000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559083680000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559084520000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559085360000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559086200000,
      "state": "26.97142857142857"
    },
    {
      "time": 1559087040000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559087880000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559088720000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559089560000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559090400000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559091240000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559092080000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559092920000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559093760000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559094600000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559095440000,
      "state": "27.100000000000005"
    }
  ]
}

4- Response Code :

200

5- Response Headers :

{
  "content-length": "3568",
  "server": "Jetty(9.4.11.v20180605)",
  "content-type": "application/json"
}

This was about making sure that you have good persisted data, which you need for charts.
Because rrd4j does some merging of older data, you’d only expect to see the last day or so of data this way.

The data that you got is all from the month of May 2019.
There won’t be any data for the hourly chart you requested.
You might get a chart for a yearly period?

But I think you broke your rrd4j persistence back in May.
If I were you, I would get rid of your strange rrd4j.cfg and try instead with the default version, get charts working before messing around with that.

I do not know where I start, please can you help me to use your proposal? (I would get rid of your strange rrd4j.cfg and try instead with the default version)

Here’s my services/rrd4j.cfg, left as default. It’s basically empty, just comments

# 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>

Stop and restart openHAB after any changes here.

I addition to the suggestions of @rossko57 I’d remove the broken .rrd file, which might prevent the creation of a new one.
If you really need a custom setup of the rrd4j-archives either look into the documentation or ask a new question, I’d be happy to help.
But for starting go with the default setup.

I try but it’s not working :frowning:

Cool. What is not working?

I’d guess the existing .rrd is preventing to create a new one. Looking at the REST output we see timesteps between readings of 840 seconds, such do NOT belong to any archive of the used .cfg (which is the same as the default archive setup).

that :

Okay. Then you’ll have to work through it again, because we cannot see what is happening and you have to tell us.

Use the REST API to find out if you are now storing recent persistence data.