Graphing in sitemap

For some reason I can not get any output on my graph:

I have @rlkoshak design pattern for persitance(rrd4j.persist):

Strategies {
        // for rrd charts, we need a cron strategy
        everyMinute : "0 * * * * ?"

        default = everyChange
}

Items {
        Group_History* : strategy = everyUpdate, everyMinute
        Group_Chart* : strategy = everyUpdate
}

My item file(chart.items):

Number Heating_LivingRoom_Setpoint (Group_SetPoint,Group_SetPoint_Command,Group_LivingRoom,Group_Chart)
Number chart_period "Graph Interval"

Finally my sitemap(admin.sitemap):

Frame {
	Switch item=chart_period label="Graph Interval" mappings=[0="Day", 1="Week", 2="Month", 3="Year"]
	Chart item=Heating_LivingRoom_Setpoint period=D refresh=30000 visibility=[chart_period==0, chart_period=="Uninitialized"]
	Chart item=Heating_LivingRoom_Setpoint period=W refresh=30000 visibility=[chart_period==1]
	Chart item=Heating_LivingRoom_Setpoint period=M refresh=30000 visibility=[chart_period==2]
	Chart item=Heating_LivingRoom_Setpoint period=Y refresh=30000 visibility=[chart_period==3]
}

But my sitemap just shows up an empty graph! I checked the Heating_LivingRoom_Setpoint.rrd file and it has some strange characters in it(base64?) so its seems to be logged data. I even deleted the file and rebooted OH, but still no graph, what am I missing? Yes I know i should switch over to the complicated grafana, infuldb but this will probably take me a day to set up, which I rather would spend on other OH stuff!(Yes I am a windows man…)

I do also have influxdb.persist with this content:

// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
        default = everyChange
}

Items {
        Group_Chart* : strategy = everyUpdate
}

If you remove the Visibility part from each Chart item - do all 4 graphs show correctly?

Strip it back to the basics - if this works, then the issue is with your Switch used for Visibility.

IMHO the ending should have been rrd! But since this file is written by the system this was probably just a typo in the post.
How do your rrd4j.cfg and .persist files look like? Are their names correct? (Some troubles have Ben reported recently because of the False file-name "rr4dj.*)

I updated the typo in the original post :slight_smile:

My rrd4j.cfg file: Plugin installed with paperUI

# please note that currently the first archive in each RRD defines the consolidation
# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
# fully supported
#
# 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=<list of items for this defname>

Just saw in your initial post that have a influxdb.persist, for rrd4j it needs to be rrd4j. persist.

I have both influxdb.persist for rrd4j,persist is that an issue?

To have both, No!
Could you check using the REST API if there is anything in your rrd4j database?

How do I do that, I just checked the file on the disk and it seems to have some base64 encoded chararcters

Your need to install REST Documentations via PaperUI Add-ons Misc.
On REST API select persistence and on that page the third get.
For serviceID put in “rrd4j” and for itemname the name of one of your persisted items ( not a group) and hit “Try it out”.
If your database contains any data you will see a reponse body like:
"{
“name”: “E10_1”,
“datapoints”: “1416”,…"
Of course with the name of your item, if the number of data points is zero, the database have no entries.
Note that the .rrd file is created before any value is persisted and it size won’t change. So the existence of that file doesn’t tell that something is saved!

Seems to be a bug in OH, that let you not install addons on https://home.myopenhab.org/paperui/index.html#/extensions

So need to head home and try it out :slight_smile:

{
  "name": "Heating_LivingRoom_Setpoint",
  "datapoints": "0",
  "data": []
}

seems like there is no data, what can be the problem?

File has this:

^@R^@R^@D^@4^@J^@,^@ ^@v^@e^@r^@s^@i^@o^@n^@ ^@0^@.^@1^@ ^@ ^@^@^@^@^@^@^@<^@^@$
^@^@^@^@^?ďż˝^@^@^@^@^@^@^?ďż˝^@^@^@^@^@^@^?ďż˝^@^@^@^@^@^@^?ďż˝^@^@^@^@^@^@^?ďż˝^@^@^@^@$

hmm, more debug…

Error handling update of file '/etc/openhab2/persistence/rrd4j.persist': null.
java.lang.NullPointerException
	at org.eclipse.smarthome.core.scheduler.ExpressionThreadPoolManager$ExpressionThreadPoolExecutor.removeFutures(ExpressionThreadPoolManager.java:321)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.scheduler.ExpressionThreadPoolManager$ExpressionThreadPoolExecutor.remove(ExpressionThreadPoolManager.java:291)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.scheduler.ExpressionThreadPoolManager$ExpressionThreadPoolExecutor.remove(ExpressionThreadPoolManager.java:308)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.removeTimers(PersistenceManagerImpl.java:321)[103:org.eclipse.smarthome.core.persistence:0.9.0.b4]
	at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.stopEventHandling(PersistenceManagerImpl.java:377)[103:org.eclipse.smarthome.core.persistence:0.9.0.b4]
	at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.removeConfig(PersistenceManagerImpl.java:348)[103:org.eclipse.smarthome.core.persistence:0.9.0.b4]
	at org.eclipse.smarthome.model.persistence.internal.PersistenceModelManager.modelChanged(PersistenceModelManager.java:85)[125:org.eclipse.smarthome.model.persistence:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:207)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:120)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:272)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.access$1(FolderObserver.java:265)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver$WatchQueueReader.processWatchEvent(FolderObserver.java:146)[122:org.eclipse.smarthome.model.core:0.9.0.b4]
	at org.eclipse.smarthome.core.service.AbstractWatchQueueReader.run(AbstractWatchQueueReader.java:122)[98:org.eclipse.smarthome.core:0.9.0.b4]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

According to your initial post., the item in question is only persisted on everychange and not everyminute.

I tried updating the persitance rule, as well as persisting other items without success! I expect it might be some issue with the persistence file in the xml database or something…Or the persistence.cfg file…

Confirm that you changed the rrd4j.persist in order to have the Group_Chart also be persisted everyMinute.

I have the number item:
Number Miflora_Sensor5_Temperature "Sensor5 Air Temperature [%.1f °C]" <text> (gMiflora, Group_Temperature,Group_Temperature_LivingRoom)

Which is a member of :
Group Group_Temperature(Group_Chart)

and the persitance file is now:

Strategies {
        // for rrd charts, we need a cron strategy
        everyMinute : "0 * * * * ?"

        default = everyChange
}

Items {
        // additionally persist weather info every minute
        Group_History* : strategy = everyUpdate, everyMinute
        Group_Chart* : strategy = everyUpdate, everyMinute
} 

and the miflora clearly get updated:
2017-11-26 13:01:04.480 [ItemStateChangedEvent ] - Miflora_Sensor5_Temperature changed from NULL to 21.8

So how come no files are here?

[13:02:30] pi@openHABianPi2:/var/lib/openhab2/persistence/rrd4j$ ls
Heating_LivingRoom_Setpoint.rrd

Earlier you stated that you are curious about the “entries” in that file. Do you have the file or not?
If you have it, try to stop OH, delete the file and then restart.

A further step would be to start logging DEBUG entries for rrd4j.
To do that log into the Karaf console and enter the command:

log:set DEBUG org.openhab.persistence.rrd4j

It seems like a mapping to the graph group item were the problem:

But it leads me to an other issue, I can not plot the average temperature of my 8 temperature sensor :frowning:

Group:Number:AVG Group_Temperature_LivingRoom(Group_Chart) "Avg. Indoor Temperature [%.1f °C]" <temperature>

Since this is not allowed and it then freezes the persistence(does not add data to any rrd4j persistence) I am stuck with plotting 1 of the temperature against the set temperature for now

I do not have any experience with groups.
However for such an average I would use a rule to calculate the average and save that to a dedicated item, which in turn can be persisted.

I have been thinking about it:) But for now I will get the rest working before adding more complexititvity to my system… I keep you posted

At least you have got rrd4j and it’s graphing working for now.