[SOLVED] Air pollution data from luftdaten.info

Thanks a lot! Followed your recommendations.
To http.cfg is added now:

luftdaten_6568.url="http://api.luftdaten.info/v1/sensor/6568/"
luftdaten_6568.updateInterval=60000

Items is:

String StrTest1 "Sensor 6568: [%s]"

Rules is as posted above, only Station ID is changed.

Sorry if asking something too obvious to others but not to me - what should be added as a text for Thing, and where to add this from above:
JSONPATH( “$[0].sensordatavalues[0].value”, json)

Thanks for your patience!

In the rule as post #9

Hi,

I stumbled across this threat and first of all thanks to the contributors of it above and the hint to luftdaten.info!
A nice addon to my weather data :slight_smile:

I just wanted to share my way of implementing it. I didn’t adopt the rule though, as I didn’t see the benefit of it for my implementation. But, I’m using your http.cfg for the below Items-file config:

Number Luftdaten_P1 "PM10: [%s µg/m³]" { http="<[luftdaten_6568:60000:JSONPATH($[0].sensordatavalues[0].value)]"}
Number Luftdaten_P2 "PM2,5: [%s µg/m³]" { http="<[luftdaten_6568:60000:JSONPATH($[0].sensordatavalues[1].value)]"}

Kurt

Thank you so much both of you for your help. I followed Kurt’s way and it’s working like charming.

Just connected my “feinstaub” sensor and used this items with http binding:

/* **************************
 * Feinstaub data
 * ************************** */
Number N_FS_SDS_PM10 "Partikelgröße 10µm [%.2f µg/m³]" { http="<[http://feinstaubsensor-14255834/data.json:80:JSONPATH($.sensordatavalues[0].value)]" }
Number N_FS_SDS_PM25 "Partikelgröße 2.5µm [%.2f µg/m³]" { http="<[http://feinstaubsensor-14255834/data.json:80:JSONPATH($.sensordatavalues[1].value)]" }
/* BME280 data*/
Number N_FS_Temperatur "Temperatur [%.2f °C]" <temperature> { http="<[http://feinstaubsensor-14255834/data.json:80:JSONPATH($.sensordatavalues[2].value)]" }
Number N_FS_Pressure "Luftdruck [%.2f hPa]" <pressure> { http="<[http://feinstaubsensor-14255834/data.json:80:JS(airpressure.js)]" }
Number N_FS_Humidity "Luftfeuchte [%.2f %%]" <water> { http="<[http://feinstaubsensor-14255834/data.json:80:JSONPATH($.sensordatavalues[4].value)]" }

I have a BME2080 sensor connected. The Humidity must be diveded by 100 to show hPa. I am doing this with a java transformation file airpressure.js:

(function(x) {
    var json = JSON.parse(x);
    return json.sensordatavalues[3].value/100;
})(input)

I hope its helpful for others…

1 Like