cloudy cloudy

Author Topic: Luftdaten Air Quality Sensor  (Read 2264 times)

0 Members and 1 Guest are viewing this topic.

Offline sunwharf

  • Nick
  • Posts: 105
  • Eastbourne, Sussex
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Nicks Website
Luftdaten Air Quality Sensor
« on: October 13, 2018, 02:23:55 PM »
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

Offline Weather Display

  • Posts: 85,453
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Weather Display
Re: Luftdaten Air Quality Sensor
« Reply #1 on: October 14, 2018, 12:41:51 AM »
do you know how its interfaced/ data protocol, etc?

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 804
  • Leuven Belgium CEST
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 69.0.3497.100
    • My PWS at Leuven Belgium Europe
Re: Luftdaten Air Quality Sensor
« Reply #2 on: October 14, 2018, 06:31:57 AM »
do you know how its interfaced/ data protocol, etc?
In the local LAN, the last data measured is retrieved by  _IP_ /data.json
Code: [Select]
{"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)
Code: [Select]
[{"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
« Last Edit: October 14, 2018, 06:56:17 AM by wvdkuil »
Leuven-Template&Scripts https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline Weather Display

  • Posts: 85,453
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Weather Display
Re: Luftdaten Air Quality Sensor
« Reply #3 on: October 14, 2018, 06:43:20 AM »
that looks doable

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 804
  • Leuven Belgium CEST
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 69.0.3497.100
    • My PWS at Leuven Belgium Europe
Re: Luftdaten Air Quality Sensor
« Reply #4 on: October 14, 2018, 07:01:11 AM »
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: https://weer.sluispark.be/index.php?p=mnu_aqhi_luft2&lang=en#data-area
I will adapt it as soon as WD has tags for current value and 24h average value.
« Last Edit: October 14, 2018, 07:04:11 AM by wvdkuil »
Leuven-Template&Scripts https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline sunwharf

  • Nick
  • Posts: 105
  • Eastbourne, Sussex
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Nicks Website
Re: Luftdaten Air Quality Sensor
« Reply #5 on: October 14, 2018, 05:44:16 PM »
Thanks for the help Wim, I am out of my depth with the heavy technical stuff :-)

Cheers
Nick

Offline Weather Display

  • Posts: 85,453
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Weather Display
Re: Luftdaten Air Quality Sensor
« Reply #6 on: October 14, 2018, 07:29:16 PM »
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

Offline sunwharf

  • Nick
  • Posts: 105
  • Eastbourne, Sussex
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Nicks Website
Re: Luftdaten Air Quality Sensor
« Reply #7 on: October 15, 2018, 12:27:50 PM »
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.

2) 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


Offline Weather Display

  • Posts: 85,453
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Weather Display
Re: Luftdaten Air Quality Sensor
« Reply #8 on: October 15, 2018, 05:59:45 PM »
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

Offline sunwharf

  • Nick
  • Posts: 105
  • Eastbourne, Sussex
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Nicks Website
Re: Luftdaten Air Quality Sensor
« Reply #9 on: October 15, 2018, 06:40:58 PM »
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


Offline Weather Display

  • Posts: 85,453
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Weather Display
Re: Luftdaten Air Quality Sensor
« Reply #10 on: October 15, 2018, 07:00:06 PM »
try adding http://
to the start off the IP address

Offline sunwharf

  • Nick
  • Posts: 105
  • Eastbourne, Sussex
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Nicks Website
Re: Luftdaten Air Quality Sensor
« Reply #11 on: October 15, 2018, 07:54:58 PM »
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.

Offline Weather Display

  • Posts: 85,453
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Weather Display
Re: Luftdaten Air Quality Sensor
« Reply #12 on: October 15, 2018, 08:15:38 PM »

Offline sunwharf

  • Nick
  • Posts: 105
  • Eastbourne, Sussex
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Nicks Website
Re: Luftdaten Air Quality Sensor
« Reply #13 on: October 15, 2018, 08:28:09 PM »
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?


Offline Weather Display

  • Posts: 85,453
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 69.0.3497.100
    • Weather Display
Re: Luftdaten Air Quality Sensor
« Reply #14 on: October 15, 2018, 08:40:47 PM »
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

 

cumulus