Luftdaten Air Quality Sensor

Hi,

Is there any chance of adding the Luftdaten air sensor to WD, please? There are a large number of these in Europe now and are probably more common than the Purpleair.

It would be great to have air quality graphs that are comparable with weather conditions.

Thanks
Nick

do you know how its interfaced/ data protocol, etc?

In the local LAN, the last data measured is retrieved by IP /data.json

{"software_version": "NRZ-2018-111", "age":"23", 
"sensordatavalues":[{"value_type":"SDS_P1","value":"10.33"},{"value_type":"SDS_P2","value":"7.43"},
{"value_type":"temperature","value":"16.50"},{"value_type":"humidity","value":"84.60"},{"value_type":"samples","value":"637531"},{"value_type":"min_micro","value":"224"},{"value_type":"max_micro","value":"26690"},{"value_type":"signal","value":"-39"}]}

One can also download the data from the luftdaten sensor database : http://api.luftdaten.info/v1/sensor/_sensor_/
Example my own sensor: http://api.luftdaten.info/v1/sensor/8993/
This json data will contain the measurements received in the last 5 minutes (often 2)

[{"sensordatavalues":[{"id":4470568566,"value_type":"P1","value":"10.33"},{"id":4470568569,"value_type":"P2","value":"7.33"}],
"sampling_rate":null,"location":{"id":4532,"altitude":"16.4","longitude":"4.7000","country":"BE","latitude":"50.8860"},
"id":2098126748,"timestamp":"2018-10-14 06:09:52","sensor":{"id":8993,"pin":"1","sensor_type":{"name":"SDS011","id":14,"manufacturer":"Nova Fitness"}}},
{"sensordatavalues":[{"id":4470591803,"value_type":"P1","value":"12.13"},{"id":4470591804,"value_type":"P2","value":"7.20"}],
"sampling_rate":null,"location":{"id":4532,"altitude":"16.4","longitude":"4.7000","country":"BE","latitude":"50.8860"},
"id":2098137815,"timestamp":"2018-10-14 06:12:21","sensor":{"id":8993,"pin":"1","sensor_type":{"name":"SDS011","id":14,"manufacturer":"Nova Fitness"}}}]

Sensor P1 measures pm10, sensor P2 measures pm2.5

Wim

that looks doable

I used for my own scripts both ways. But it would be far better if weather-programs would include that pm2.5 value also. Including high-lows and especially 24 hour average values. All AQ-indexes and health-warnings are based on the 24-hour average measurements / forecasts.

Wim

P.S. This is my script: AQ Luftdaten sensor - Leuven-Sluispark
I will adapt it as soon as WD has tags for current value and 24h average value.

Thanks for the help Wim, I am out of my depth with the heavy technical stuff :slight_smile:

Cheers
Nick

first beta
http://www.weather-display.com/downloadfiles/weatherdisplaytest.zip

enter the needed IP address and tick that its a Luftdaten sensor
then click on test
then see if the pm2.5 and air quality value is shown correct

Thanks Brian,

Have run a test and it’s not quite right.

  1. If I enter local IP address as 192.168.1.120 in the IP address box (the network address of the sensor unit), 2455820 in the sensor ID box, tick luftdaten type and then click “Test” I get error message “276:error during handshake(2) 0x80090308”. The result shown in Particles 2.5 is “Values” and AQI result is 0.0

The only other box ticked is “Enabled” The number 2455820 I entered is the local sensor number but the same result occurs whether the box is populated or not.

To double check the sensor was working, I accessed the sensor via a browser using that IP and was able to get in to the interface just fine.

  1. Just in case I misunderstood I tried the URL method suggested by Wim.

As per Wim I entered http://api.luftdaten.info/v1/sensor/14396/ in the IP address field (where 14396 is my Luftdaten sensor ID) and then clicked “test”. This didn’t produce an error message but only returned “Values” and “0.0” respectively.

Hope that helps

Cheers
Nick

Hi
I was not meaning you to enter a sensor ID
just the local IP
as the format
IP /data.json

as per what wvdkuil had provided already
do that and then post here the airquality2.txt file after clicking on test

Ah ok Brian, very sorry I’m not very technical so missed that.

I’ve done that and I get an error message “152: No server specified in URL”

There is just one line in airquality2.txt and it reads
{“mapVersion”:“0.70”,“baseVersion”:“6”,“mapVersionString”:“”,“results”:[]}

I have attached a screen print of my settings just in case I have misunderstood again

Cheers
Nick


try adding http://
to the start off the IP address

Ah, that sort of worked. No error message appears

airquality2.txt now has:

{“software_version”: “NRZ-2018-111”, “age”:“80”, “sensordatavalues”:[{“value_type”:“SDS_P1”,“value”:“17.67”},{“value_type”:“SDS_P2”,“value”:“13.90”},{“value_type”:“samples”,“value”:“634677”},{“value_type”:“min_micro”,“value”:“225”},{“value_type”:“max_micro”,“value”:“26883”},{“value_type”:“signal”,“value”:“-83”}]}

The particle value shown on screen is odd (see attached screen grab)but only looks like it’s picking up the wrong field. The P2 data in airquality2.txt matches the current value in the sensor.


try new update
http://www.weather-display.com/downloadfiles/weatherdisplaytest.zip

Oh wow, that worked.

Airquality2.txt reads:
{“software_version”: “NRZ-2018-111”, “age”:“0”, “sensordatavalues”:[{“value_type”:“SDS_P1”,“value”:“57.47”},{“value_type”:“SDS_P2”,“value”:“28.70”},{“value_type”:“samples”,“value”:“636748”},{“value_type”:“min_micro”,“value”:“225”},{“value_type”:“max_micro”,“value”:“26692”},{“value_type”:“signal”,“value”:“-82”}]}

The WD setup screen reads pm2.5 as 28.7 (see attached)

The sensor reads the same (see attached)

Thanks a lot Brian, does that mean it’s good to go?


yes, hopefully now WD should be running the cronairquality.exe program every minute and updating the data auto now
for PM2 and the calculated AQI
for now at least
I could add in to get PM1

The cron seems to be running but this pops up (see attached)?

It doesn’t seem to relate to the Luftdaten sensor details.


wd cron.jpg

download a new .zip test program update, same url as before

new WD version (PM1 should work now) and new cronairquality version…should work now

Hi Brian,

I’ve done that and the cron seems to be running as the airquality2.txt changes it’s time every minute and the data seems to change too.

Nothing else seems to be happening, so I’ll leave it to run over night and see what the morning shows on the main graph.

If I go into the purpleair icon in “View” I don’t see the correct readings? (see attached)

My sensor only does PM10 and PM2.5 so don’t think I can test PM1

Cheers
Nick


Hi again Brian,

The aqi charts are being produced but are straight lining at zero and I would have imagined the first readings would have shown by now. As I said, I’ll leave overnight and see in the morning

Thanks again for doing this

Cheers
Nick

I have fixed a few more things up,hopefully
download another .zip test version update, ready now, same url