Hello,
I am using openhab 2.2.0 on a Raspberry Pi2. Two temperature/humidity sensors are reporting their values via MQTT to OH.
I have defined these two items as follows:
String mqttReedTemp "Temp [%s]" {mqtt="<[mosquitto:/sensors/fenster-dach-bad:state:JSONPATH($.temperature)]"}
String mqttReedHumidity "Hum [%s]" {mqtt="<[mosquitto:/sensors/fenster-dach-bad:state:JSONPATH($.humidity)]"}
String mqttGarageTemp "Temp [%s]" {mqtt="<[mosquitto:/sensors/garage:state:JSONPATH($.temperature)]"}
String mqttGarageHumidity "Humidity [%s]" {mqtt="<[mosquitto:/sensors/garage:state:JSONPATH($.humidity)]"}
Group gTemperatures
String mqttReedTemp "Dach/Bad" (gTemperatures)
String mqttGarageTemp "Aussen" (gTemperatures)
Group gHumidities
String mqttReedHumidity "Dach/Bad LF" (gHumidities)
String mqttGarageHumidity "Aussen LF" (gHumidities)
My rrd4j.persist look as follows:
Strategies {
everyMinute:"0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyMinute
}
Items {
mqttReedTemp : strategy = everyMinute, restoreOnStartup
mqttReedHumidity : strategy = everyMinute, restoreOnStartup
mqttGarageTemp : strategy = everyMinute, restoreOnStartup
mqttGarageHumidity : strategy = everyMinute, restoreOnStartup
}
The corresponding rrd definition look like this:
temp.def=GAUGE,120,-50,100,60
temp.archives=AVERAGE,0.5,1,10080:AVERAGE,0.5,60,89280
temp.items=mqttRaspberryPiCpuTemp,mqttReedTemp,mqttGarageTemp
humidity.def=GAUGE,120,0,100,60
humidity.archives=AVERAGE,0.5,1,10080:AVERAGE,0.5,60,89280
humidity.items=mqttReedHumidity,mqttGarageHumidity
Now the two charts look like this:
!They are defined as follows in my sitemap:
Frame label="Temperaturen" {
Chart item=gTemperatures period=D refresh=10000 label="Aussen Hum"
}
Frame label="Luftfeuchtigkeit" {
Chart item=gHumidities period=D refresh=10000 label="Luftfeuchtigkeit"
}
All rrd4j files are present:
pi@raspberrypi /opt/openhab/openhab-2.2.0/conf $ ll ../userdata/persistence/rrd4j/*Hum*
-rw-r--r-- 1 openhab openhab 86936 Feb 12 19:42 ../userdata/persistence/rrd4j/mqttGarageHumidity.rrd
-rw-r--r-- 1 openhab openhab 86936 Feb 12 19:42 ../userdata/persistence/rrd4j/mqttReedHumidity.rrd
-rw-r--r-- 1 openhab openhab 795224 Feb 12 19:43 ../userdata/persistence/rrd4j/mqttGarageTemp.rrd
-rw-r--r-- 1 openhab openhab 795224 Feb 12 19:43 ../userdata/persistence/rrd4j/mqttRaspberryPiCpuTemp.rrd
-rw-r--r-- 1 openhab openhab 795224 Feb 12 19:43 ../userdata/persistence/rrd4j/mqttReedTemp.rrd
The DEBUG log says that the values are correct:
2018-02-12 19:43:00.095 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Stored 'mqttGarageTemp' with state '1.00' in rrd4j database
2018-02-12 19:43:00.113 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Stored 'mqttGarageHumidity' with state '86.00' in rrd4j database
2018-02-12 19:44:00.076 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Stored 'mqttReedTemp' with state '10.0' in rrd4j database
2018-02-12 19:44:00.089 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Stored 'mqttReedHumidity' with state '50.0' in rrd4j database
Any ideas why the first chart looks good and second one not?