Hi, my goal is to log my three temperature sensors to RRD4J and display them in a chart.
Seems not to work, since I am getting an empty chart and there is no evidence in the file system to the temperatures being logged. What am I doing wrong? Is anything needed to be done in the openhab.cfg? I am running 1.8.0-SNAPSHOT, the temperatures are being displayed correctly in a “String” item:
Strategies {
everyMinute:"0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
// if no strategy is specified for an item entry below, the default list will be used
default = everyChange
}
Items {
Temp_* : strategy = everyMinute, restoreOnStartup
}
The openhab.log notes, that this is being read upon startup:
2015-08-31 22:40:26.402 [INFO ] [.o.core.internal.CoreActivator] - openHAB runtime has been started (v1.8.0).
2015-08-31 22:40:54.846 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - mDNS service has been started
2015-08-31 22:40:56.279 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - Service Discovery initialization completed.
2015-08-31 22:41:05.696 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'rrd4j.persist'
My addons-folder contains the following persistency-addons:
-rw-r--r-- 1 root root 6194 Aug 30 00:13 org.openhab.persistence.exec-1.8.0-SNAPSHOT.jar
-rw-r--r-- 1 root root 7415 Aug 30 00:13 org.openhab.persistence.logging-1.8.0-SNAPSHOT.jar
-rw-r--r-- 1 root root 624568 Aug 30 00:13 org.openhab.persistence.rrd4j-1.8.0-SNAPSHOT.jar
Take a look at your rrd4j.persist: I’m quite sure that the asterisk in items is used to denote group items. I think a * cannot be used as a wildcard for item names.
// persist all items once a day and on every change and restore them from the db at startup
* : strategy = everyChange, everyDay, restoreOnStartup
// additionally, persist all temperature and weather values every hour
Temperature*, Weather* : strategy = everyHour
This indicates that Temperature* will log all temperatures.
I’m reasonably sure that the problem is that strings can not be persisted in RRD (there may be other problems as well, but it won’t work until numbers are used).
The wiki page says that a single single asterisk selects all items in the system, but a name followed by an asterisk stands for a group item:
* - this line should apply to all items in the system.
<itemName> - a single item identified by its name. This item can be a group item, but note that only its own (group) value will be persisted, not the states of its members.
<groupName>* - all members of this group will be persisted, but not the group itself. If no strategies are provided, the default strategies that are declared in the first section are used. An alias can be optionally provided, if the persistence service requires special names (e.g. a table to use in a database, a feed id for an IoT-service etc.)
The author of the question tries to persist items based on a wildcard match on Temp_*, which is not a group in his item definitions. I think gMyGroup* : strategy = everyMinute, restoreOnStartup should work here.
Fair point, but I don’t think this will completely stop it working as the default strategy would also result in data being persisted (although the everyChange strategy will not be reliable for RRD as it needs everyMinute, but it would still persist data).
I still think the initial problem is that RRD will not log strings…
I too had this confusion with the asterisk being used as the group identifier (and personally think it is very counter intuitive). The setup in the Wiki is using the notion that the items are added to the groups called Temperature and Weather when they are created… not that it is referencing all items starting with Temperature or Weather.
Regardless of what RRD can store… I don’t see how one can imagine graphing a string value.
I recently encountered a similar issue and found this topic on Google.
For some reason the °C is causing troubles. Since other units are working properly (for e.g. ``%`), I guess the little circle is the problem.
So this doesn’t work:
Number Temp_Outside "Temp. Out [%.1f °C]" <temperature> (gMyGroup) {myBinding}
What works however is:
Number Temp_Outside "Temp. Out [%.1f]" <temperature> (gMyGroup) {myBinding}
When editing your item definition, be sure to delete the according persistence file as well, since it is already contaminated with the little °C bug at this time.
In this example: Shut OpenHAB down, delete <OPENHAB_HOME>/etc/rrd4j/Temp_Outside.rrd and bring the system back up again.
I guess that on the first matching line, that is whats logged, and no further lines are read. Resulting in me only seeing the dots in the charts where a change actually happened.
Charts need at least one point every minute, so only logging on change is not enough.
Although my issue was with the openhab2 persistent binding, it might be the same in openhab1.