Hey folks, first of all i am quiet new to the OpenHAB community. I read a lot of topics and saw that the pros here are very helpfull IF we newbies read the docs but i actually cant find a solution for my problem.
I would like to show the Temperature and the Humidity from my ESP8266 with a DHT22 Sensor in a chart on my Sitemap and in the Android App.
I Installed the MQTT Broker on OpenHAB and Mosquitto as a Server on the Pi (OpenHAB and Mosquitto server are the same Pi). I can see the values ââin MQTT.fx and on my Sitemap.
Now i want to make a chart for day, week, month and year. But i think mqtt is not saving the data in rrd4j.
rrd4j.persist:
Strategies {
everyMinute: "0 * * * *?"
everyHour: "0 0 * * *?"
everyDay: "0 0 0 * *?"
default = everyChange
}
Items {
gDHT22_Sensor* : strategy = everyMinute, everyChange, restoreOnStartup
}
graph.items
Group gDHT22_Sensor "Chart Group"
Number chart period
Number FilaBox_Luftfeuchte "Humidity Filabox [% ââ.1f %%]" <humidity> (gDHT22_Sensor) {mqtt="<[mosquitto:/esp8266/sensor2_humidity_1]"}
Number FilaBox_Temp "Filabox temperature [% .1f °C]" <temperature> (gDHT22_Sensor) {mqtt="<[mosquitto:/esp8266/sensor2_temperature_1]"}
At this point i am not sure exactly what do i need to input for the broker name (called here mosquitto). Is mosquitto the right one here or is it a specific name or maybe localhost for the same System?
default.sitemap
Frame label = "Filament Box" {
Text item = ESP8266_DHT22_temperature label = "Temperatur [% .1f ° C]" icon = "temperature"
Text item = ESP8266_DHT22_humidity label = "Humidity [% .1f %%]" icon = "humidity"
Frame label = "Graphic of the values" icon = "chart" {
Switch item = chartPeriode label = "Period" mappings = [0 = "Day", 1 = "Week", 2 = "Month", 3 = "Year"]
Chart item = gDHT22_Sensor period = D refresh = 60000 service = "rrd4j" visibility = [chartPeriode == 0]
Chart item = gDHT22_Sensor period = W refresh = 60000 service = "rrd4j" visibility = [chartPeriode == 1]
Chart item = gDHT22_Sensor period = M refresh = 60000 service = "rrd4j" visibility = [chartPeriode == 2]
Chart item = gDHT22_Sensor period = Y refresh = 60000 service = "rrd4j" visibility = [chartPeriode == 3]
}
}
And finally some details from the REST API
GET / persistence / items / {itemname}
Curl
curl -X GET --header "Accept: application / json" "http://192.168.xxx.xxx:8080/rest/persistence/items/FilaBox_Temp?serviceId=rrd4j"
Request url
http://192.168.xxx.xxx:8080/rest/persistence/items/FilaBox_Temp?serviceId=rrd4j
Response body
{
"name": "FilaBox_Temp",
"datapoints": "0",
"data": []
}
is that correct that the mqtt does not safe any data to rrd4j and i can saw that at the zero datapoints?
i appriciate any help
Greetings Hendrik