[SOLVED] Chart generation is null

  • Platform information:
    • Hardware: Raspberry Pi3
    • OS: OpenHabian 2.4
    • Java Runtime Environment: 1.8
    • openHAB version: 2.4

I am having a problem getting charts to generate in my BasicUI. I just bought a Philips Hue motion sensor and in addition to turning lights on via motion sensor (which I have working), I realised it can take temperature as well. I have the temperature value showing up in my BasicUI but I would like to track it over time. I have enabled persistence (using rrd4j) but I cannot seem to get the charts to generate. When I try to show the chart, the log file says:

2019-04-21 11:00:07.398 [WARN ] [thome.ui.internal.chart.ChartServlet] - Chart generation failed: null

I was trying to follow various posts about generating charts in the forums as well as from the demo setup, but no joy.

Here are the relevent Items:

Group:Number:AVG gTemperature “Avg. Room Temerature [%.1f]” (Status)
Group Temperature_Chart_GF_MBR
Number Temperature_GF_MBR “Master Bedroom [%.1f]” (gGF_MBR,gTemperature) [ “Temperature”,“Measurement” ] { channel=“hue:0302:ecb5fa0447a0:7:temperature” }
Number Temperature_Chart_Period “Chart Period”

Here is the entry in my Sitemap:

Frame label=“Temperature Charts”
{
Switch item=Temperature_Chart_Period label=“Chart Period” icon=“chart” mappings=[0=“Hour”,1=“Day”,2=“Week”,3=“Month”,4=“Year”]
Chart item=Temperature_Chart_GF_MBR period=h refresh=6000000 visibility=[Temperature_Chart_Period==0,Temperature_Chart_Period==“NULL”]
Chart item=Temperature_Chart_GF_MBR period=D refresh=3600000 visibility=[Temperature_Chart_Period==1,Temperature_Chart_Period==“NULL”]
Chart item=Temperature_Chart_GF_MBR period=W refresh=3600000 visibility=[Temperature_Chart_Period==2,Temperature_Chart_Period==“NULL”]
Chart item=Temperature_Chart_GF_MBR period=M refresh=3600000 visibility=[Temperature_Chart_Period==3,Temperature_Chart_Period==“NULL”]
Chart item=Temperature_Chart_GF_MBR period=Y refresh=3600000 visibility=[Temperature_Chart_Period==4,Temperature_Chart_Period==“NULL”]
}

I can see the file ‘Temperature_GF_MBR.rrd’ being generated and updated (based on time stamp) in ‘/var/lib/openhab2/persistence/rrd4j’

Your input is greatly appreciated! :slight_smile:

Thanks, in advance.

You did not post your persistence configuration. For rrd4j to generate charts, you must have everyMinute as persistence strategy added.

Sorry, yes, I did forget. Here is my rrd4j.persist file:

Strategies {
everyMinute : “0 * * * * ?”
default = everyChange
}
Items {
gTemperature* : strategy = everyUpdate, everyMinute
Temperature_Chart* : strategy = everyUpdate, everyMinute
}

I have also set rrd4j as my default persistence.

You could use the REST API to check if the .rrd file is really getting values.
The database might have got broken because of a change of datatype of the persisted item. In this case stop openhab, remove the .rrd file and restart.

How do I check the RRD file through the REST API.

I have stopped OpenHAB and deleted the RRD fles a couple of times already :frowning:

Install REST API via PaperUI Addons Misc.
However, if you did the procedure it might be something else.

I already have the REST API installed; I just don’t know how to check if the RRD file has data in it via the REST API.

Open the REST APIfrom the dashboard,
select persistence
Select the third blue GET ( /persistence/itmems/{itemname})
Set serviceID to rrd4j and the item name to your item name
Hit the " Try it out!" button.
You will get displayed the name, the number of data points and the data.

Sorry for late reply, we had interruption of power supply which resulted in a breakdown of my installation. Recovered now.

Thanks for that! So according to the output, it looks like the data is not getting recorded:

{
“name”: “Temperature_Chart_GF_MBR”,
“datapoints”: “0”,
“data”:
}

Back to the drawing board, I guess :frowning:

So it is the persistence which doesn’t work. Recheck everything!
Another hint: By using the PersistenceViewer in Habpanel you could check the correct setup of grouped items and if something is really persisted on the fly.

If that is still your setup? You have a group named “Temperature_Chart_GF_MBR” but you asign the item to the group “gGF_MBR”.
I can’t tell if the persist strategy which only addresses gTemperature and Temperature_chart ( not existing) does have the effect that charting of group "Temperature_Chart_GF_MBR " result in NULL.

Based on Opus’ comments, I re-checked everything and realised that the number I was trying to graph was not a member of the correct group I had setup. I don’t want to to go into too much detail because I am going to be changing a number of things with my setup and names (so what I put down will be incorrect very soon), but I have figured out what I did wrong :slight_smile:

Thanks!

1 Like