Luftdaten Air Quality Sensor

Hi,

These tags were posted in the purpleair strangeness thread.
I got the the first 3 working using the luftdaten sensor.

The others do not work.
Are they for the purple air sensor only?

$purpleair2_5 = ‘32.0’; //Value of 2.5 micron particle measure from purple air sensor (see in WD under setup, advanced/misc)
$purpleair10_0 = ‘282.3’; //Value of 10.0 micron particle measure from purple air sensor
$purpleairaqi = ‘94.7’; //AQI (air quality index) value from purple air sensor

$purpleair24hourmean10_0 = ‘282.3’; //Last 24 hours average PM 10.0 value
$purpleair24hourmean2_5 = ‘48.1’; //Last 24 hours average PM 2.5 value
$purpleair24hourmin10_0 = ‘0.0’; //Min value in last 24 hours PM 10.0 value
$purpleair24hourmin2_5 = ‘-1.0’; //Min value in last 24 hours PM 2.5 value
$purpleair24hourmax10_0 = ‘282.3’; //Max value in last 24 hours PM 10.0 value
$purpleair24hourmax2_5 = ‘96.1’; //Max value in last 24 hours PM 2.5 value

how do you mean not working exactly?

From my testtags.php
No values, tekst instead.

$purpleair2_5 = ‘25.3’; //Value of 2.5 micron particle measure from purple air sensor (see in WD under setup, advanced/misc)
$purpleair10_0 = ‘37.1’; //Value of 10.0 micron particle measure from purple air sensor
$purpleairaqi = ‘78.8’; //AQI (air quality index) value from purple air sensor

$purpleair60minmean2_5 = ‘%purpleair60minmean2_5%’; //Last 60 minutes average PM 2.5 value
$purpleair60minmean10_0 = ‘%purpleair60minmean10_0%’; //Last 60 minutes average PM 10.0 value
$purpleair24hourmean2_5 = ‘%purpleair24hourmean2_5%’; //Last 24 hours average PM 2.5 value
$purpleair24hourmean10_0 = ‘%purpleair24hourmean10_0%’; //Last 24 hours average PM 10.0 value

$purpleair60minmin2_5 = ‘%purpleair60minmin2_5%’; //Min value in last 60 minutes PM 2.5 value
$purpleair24hourmin2_5 = ‘%purpleair24hourmin2_5%’; //Min value in last 24 hours PM 2.5 value
$purpleair60minmin10_0 = ‘%purpleair60minmin10_0%’; //Min value in last 60 minutes PM 10.0 value
$purpleair24hourmin10_0 = ‘%purpleair24hourmin10_0%’; //Min value in last 24 hours PM 10.0 value

$purpleair60minmax2_5 = ‘%purpleair60minmax2_5%’; //Max value in last 60 minutes PM 2.5 value
$purpleair24hourmax2_5 = ‘%purpleair24hourmax2_5%’; //Max value in last 24 hours PM 2.5 value
$purpleair60minmax10_0 = ‘%purpleair60minmax10_0%’; //Max value in last 60 minutes PM 10.0 value
$purpleair24hourmax10_0 = ‘%purpleair24hourmax10_0%’; //Max value in last 24 hours PM 10.0 value

those tags don’t exist

the tags that do exist are in the tagslist.txt
ie
Air Quality

%purpleair2_5%…Value of 2.5 micron particle measure from purple air sensor (see in WD under setup, advanced/misc)
%purpleair1_0%…Value of 1.0 micron particle measure from purple air sensor
%purpleair10_0%…Value of 10.0 micron particle measure from purple air sensor
%purpleairaqi%…AQI (air quality index) value from purple air sensor
%purpleairaqidescription%…AQI description (e.g Good, moderate)
%60minmeanpurpleair10_0%…Last 60 minutes average PM 10.0 value
%60minmeanpurpleair2_5%…Last 60 minutes average PM 2.5 value
%24hourmeanpurpleair10_0%…Last 24 hours average PM 10.0 value
%24hourmeanpurpleair2_5%…Last 24 hours average PM 2.5 value
%60minminpurpleair10_0%…Min value in last 60 minutes PM 10.0 value
%24hourminpurpleair10_0%…Min value in last 24 hours PM 10.0 value
%60minminpurpleair2_5%…Min value in last 60 minutes PM 2.5 value
%24hourminpurpleair2_5%…Min value in last 24 hours PM 2.5 value
%60minmaxpurpleair10_0%…Max value in last 60 minutes PM 10.0 value
%24hourmaxpurpleair10_0%…Max value in last 24 hours PM 10.0 value
%60minmaxpurpleair2_5%…Max value in last 60 minutes PM 2.5 value
%24hourmaxpurpleair2_5%…Max value in last 24 hours PM 2.5 value
$avairjan2_5 = ‘%avairjan2_5%’;
$avairfeb2_5 = ‘%avairfeb2_5%’;
$avairmar2_5 = ‘%avairmar2_5%’;
$avairapr2_5 = ‘%avairapr2_5%’;
$avairmay2_5 = ‘%avairmay2_5%’;
$avairjun2_5 = ‘%avairjun2_5%’;
$avairjul2_5 = ‘%avairjul2_5%’;
$avairaug2_5 = ‘%avairaug2_5%’;
$avairsep2_5 = ‘%avairsep2_5%’;
$avairoct2_5 = ‘%avairoct2_5%’;
$avairnov2_5 = ‘%avairnov2_5%’;
$avairdec2_5 = ‘%avairdec2_5%’;
$avairjan10_0 = ‘%avairjan10_0%’;
$avairfeb10_0 = ‘%avairfeb10_0%’;
$avairmar10_0 = ‘%avairmar10_0%’;
$avairapr10_0 = ‘%avairapr10_0%’;
$avairmay10_0 = ‘%avairmay10_0%’;
$avairjun10_0 = ‘%avairjun10_0%’;
$avairjul10_0 = ‘%avairjul10_0%’;
$avairaug10_0 = ‘%avairaug10_0%’;
$avairsep10_0 = ‘%avairsep10_0%’;
$avairoct10_0 = ‘%avairoct10_0%’;
$avairnov10_0 = ‘%avairnov10_0%’;
$avairdec10_0 = ‘%avairdec10_0%’;
$avairjannow2_5 = ‘%avairjannow2_5%’;
$avairfebnow2_5 = ‘%avairfebnow2_5%’;
$avaimarnow2_5 = ‘%avaimarnow2_5%’;
$avairaprnow2_5 = ‘%avairaprnow2_5%’;
$avairmaynow2_5 = ‘%avairmaynow2_5%’;
$avairjunnow2_5 = ‘%avairjunnow2_5%’;
$avairjulnow2_5 = ‘%avairjulnow2_5%’;
$avairaugnow2_5 = ‘%avairaugnow2_5%’;
$avairsepnow2_5 = ‘%avairsepnow2_5%’;
$avairoktnow2_5 = ‘%avairoktnow2_5%’;
$avairnovnow2_5 = ‘%avairnovnow2_5%’;
$avairdecnow2_5 = ‘%avairdecnow2_5%’;
$avairjannow10_0 = ‘%avairjannow10_0%’;
$avairfebnow10_0 = ‘%avairfebnow10_0%’;
$avairmarnow10_0 = ‘%avairmarnow10_0%’;
$avairaprnow10_0 = ‘%avairaprnow10_0%’;
$avairmaynow10_0 = ‘%avairmaynow10_0%’;
$avairjunnow10_0 = ‘%avairjunnow10_0%’;
$avairjulnow10_0 = ‘%avairjulnow10_0%’;
$avairaugnow10_0 = ‘%avairaugnow10_0%’;
$avairsepnow10_0 = ‘%avairsepnow10_0%’;
$avairoctnow10_0 = ‘%avairoctnow10_0%’;
$avairnovnow10_0 = ‘%avairnovnow10_0%’;
$avairdecnow10_0 = ‘%avairdecnow10_0%’;

%purpleair2_52% …2nd sensor 2.5 reading
%purpleair1_02% …2nd sensor 1.0 reading
%purpleair10_02% …2nd sensor 10 reading
%purpleairaqi2% …2nd sensor aqi reading
%purpleairaqidescription2% …2nd sensor aqi description

Thanks,

Working now.

I have an SDS011 sensor and reading the values with a python script. In python, I output the values into a json:


# append new values
data = {'sensordatavalues':[{'value_type':'SDS_P1','value':str(values[1])},{'value_type':'SDS_P2','value':str(values[0])}]}

In WD, I use this json file (and the “Luftdaten” option) to log the PM2.5 and PM10. Works nicely with latest build (Nov16). However, I do occasionally (actually quite often) get zero readings in WD. To verify my data was “produced” OK, I log same values at the same time into a separate txt file with a timestamp. I do this at one minute interval. In my log file, there are no zeros.

Is there any way to detect if the json file is corrupt (hence the zero reading) or ?
I also modified my script to output integer values only but the zeros were still there.

Alternatively, is there a way that airquality2.txt could be used for the PM10 in addition to PM2.5 ?

Thanks.

Maybe WD is trying to read the file while it is being written? Are you writing it to a temp file and renaming?

No, I’m writing directly into the file… Thanks for suggestion, I’ll try to create a temp file and just rename it!

niko, you solved my problem! Thanks!

That’s good news :smiley: It’s probably not 100% guaranteed, but the chance that the file is unavailable should be greatly reduced. You could also try offsetting the file creation time some seconds from the top of the minute.

Hi Brian
Many thanks. I now have my Luftdaten running and both the 2.5 and 10 results completely agreed with the unit data. Actually I had an extreme test - the sensor is running indoors for testing (and yet to add the temp/hum sensor) and I had just lit my woodburner for the first time this year. I forgot to clear the dust out from under the top cover which then burnt off and filled the house with smoke. 2.5 and 10 were off the scale !!!
For some reason the 10 level has stopped showing as a figure but shows on the graph.
A request - any chance of having a second 10 needle on the dial ? Or an option to display the two.
Thanks again
Alan

which scale and where exactly?

Hi Brian
The scale on your dial stops at 500 but my 2.5 reading was up in the 700’s - hence off the scale.
I also realise that the 10 sensing must happen at a different time as it did show up on the view purple screen (I had just changed the config of the particle sensor which resets the sensor - I had just reset mine to 5 minute intervals).
Is there a way I can put the readings on my site in figures ?
Rather than a second needle on the dial would it be possible to create a 10 dial gif for use on the website - not necessarily shown on the view purple screen.
Regards
Alan

now sure what you mean by a 10 dial gif?

there are custom tags available for the raw data

Hi Brian
I just meant a dial gif for the PM10 levels as aqi.gif is for pm2.5
Regards
Alan

Sorry Brian
I misunderstood - the dial is AQ Index - I thought it was PM2.5.
Regards
Alan

hoping to find the spare time to add support for the temperature and humidity data soon

Hi Brian
I noticed the AQI line does not appear on the webfiles graph.gif.
Would it also be possible to add the scale to the side of the main screen graph. One small point the AQI figure just above the graph is a fraction too high and gets hidden by the wind direction graph.
Thanks a lot
Alan

can you post a screen shot of what you are seeing re the last sentence?

Hi Brian
Forget that - it just means moving the wind direction graph up a bit and the AQI is visible
Regards
Alan