Page 1 of 2

Add PurpleAir sensor to list of AQI sensors?

Posted: Tue 02 Feb 2021 4:08 am
by saratogaWX
Hi Mark,
I see that MX supports multiple AQI sensors (Airlink, Ecowitt). Would you consider adding PurpleAir to the AQI sensors supported by MX?

Thanks in advance for your consideration.

Best regards,
Ken

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Tue 02 Feb 2021 8:00 am
by ConligWX
I'm gonna second that Ken, since I have one of these too.

Mark, there is info here if needed: https://docs.google.com/document/d/15ij ... wnbCU/edit

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Tue 02 Feb 2021 10:28 am
by HansR
I think a device independent Air Quality datamodel is needed before adding more of that type of devices. Now each device (AirLink, Ecowitt) have their own tables/fields.
In general yes, PurpleAir should be there.

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Thu 04 Feb 2021 5:15 pm
by mcrossley
So there is no direct access to the PA devices locally, you have to pull it from their servers?

Anyway, I'm not ruling it out, but at the moment I am feature freezing MX whilst I work on improving what is already there.

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Thu 04 Feb 2021 5:41 pm
by saratogaWX
There's a direct query that can be made to the PurpleAir sensor like

http://192.168.1.186/json (for my dual sensor 4299, 4300)

which results in

Code: Select all

{
  "SensorId": "a0:20:a6:a:a2:7a",
  "DateTime": "2021/02/04T17:33:30z",
  "Geo": "PurpleAir-a27a",
  "Mem": 18992,
  "memfrag": 22,
  "memfb": 14808,
  "memcs": 800,
  "Id": 34365,
  "lat": 37.274700,
  "lon": -122.022903,
  "Adc": 0.01,
  "loggingrate": 15,
  "place": "outside",
  "version": "6.01",
  "uptime": 1376382,
  "rssi": -74,
  "period": 120,
  "httpsuccess": 69140,
  "httpsends": 69195,
  "hardwareversion": "2.0",
  "hardwarediscovered": "2.0+OPENLOG+16021 MB+DS3231+BME280+PMSX003-B+PMSX003-A",
  "current_temp_f": 58,
  "current_humidity": 34,
  "current_dewpoint_f": 30,
  "pressure": 1014.06,
  "p25aqic_b": "rgb(0,228,0)",
  "pm2.5_aqi_b": 0,
  "pm1_0_cf_1_b": 0.00,
  "p_0_3_um_b": 156.70,
  "pm2_5_cf_1_b": 0.00,
  "p_0_5_um_b": 42.07,
  "pm10_0_cf_1_b": 0.18,
  "p_1_0_um_b": 1.20,
  "pm1_0_atm_b": 0.00,
  "p_2_5_um_b": 0.23,
  "pm2_5_atm_b": 0.00,
  "p_5_0_um_b": 0.23,
  "pm10_0_atm_b": 0.18,
  "p_10_0_um_b": 0.00,
  "p25aqic": "rgb(0,228,0)",
  "pm2.5_aqi": 0,
  "pm1_0_cf_1": 0.00,
  "p_0_3_um": 90.31,
  "pm2_5_cf_1": 0.00,
  "p_0_5_um": 23.49,
  "pm10_0_cf_1": 0.00,
  "p_1_0_um": 2.05,
  "pm1_0_atm": 0.00,
  "p_2_5_um": 0.25,
  "pm2_5_atm": 0.00,
  "p_5_0_um": 0.00,
  "pm10_0_atm": 0.00,
  "p_10_0_um": 0.00,
  "pa_latency": 324,
  "response": 201,
  "response_date": 1612459931,
  "latency": 326,
  "key1_response": 200,
  "key1_response_date": 1612459925,
  "key1_count": 1011344,
  "ts_latency": 580,
  "key2_response": 200,
  "key2_response_date": 1612459926,
  "key2_count": 1024200,
  "ts_s_latency": 516,
  "key1_response_b": 200,
  "key1_response_date_b": 1612459928,
  "key1_count_b": 1030898,
  "ts_latency_b": 986,
  "key2_response_b": 200,
  "key2_response_date_b": 1612459929,
  "key2_count_b": 1032050,
  "ts_s_latency_b": 500,
  "wlstate": "Connected",
  "status_0": 2,
  "status_1": 2,
  "status_2": 2,
  "status_3": 2,
  "status_4": 2,
  "status_5": 2,
  "status_6": 2,
  "status_7": 0,
  "status_8": 2,
  "status_9": 2,
  "ssid": "*redacted*"
}
Take a look at https://www.github.com/MarcinZukowski/purp to see some sample code (JS/HTML)

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Thu 04 Feb 2021 5:50 pm
by mcrossley
Thanks Ken, and do we have a decode of those key names and values mean (apart from the obvious ones)?

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Thu 04 Feb 2021 11:15 pm
by ConligWX
Here is mine Mark with Gas Sensor too (BME680 sensor)

Code: Select all

{
	"SensorId": "5c:cf:7f:5c:a4:24",
	"DateTime": "2021/02/04T23:13:01z",
	"Geo": "PurpleAir-a424",
	"Mem": 18880,
	"memfrag": 15,
	"memfb": 16064,
	"memcs": 736,
	"Id": 38842,
	"lat": 54.634201,
	"lon": -5.672,
	"Adc": 0.03,
	"loggingrate": 15,
	"place": "outside",
	"version": "6.01",
	"uptime": 369635,
	"rssi": -63,
	"period": 119,
	"httpsuccess": 234368,
	"httpsends": 234514,
	"hardwareversion": "2.0",
	"hardwarediscovered": "2.0+OPENLOG+15833 MB+DS3231+BME280+BME680+PMSX003-B+PMSX003-A",
	"current_temp_f": 52,
	"current_humidity": 70,
	"current_dewpoint_f": 42,
	"pressure": 998.33,
	"current_temp_f_680": 54,
	"current_humidity_680": 71,
	"current_dewpoint_f_680": 44,
	"pressure_680": 998.01,
	"gas_680": 25.0,
	"p25aqic_b": "rgb(2,228,0)",
	"pm2.5_aqi_b": 10,
	"pm1_0_cf_1_b": 0.55,
	"p_0_3_um_b": 304.07,
	"pm2_5_cf_1_b": 2.29,
	"p_0_5_um_b": 84.41,
	"pm10_0_cf_1_b": 4.98,
	"p_1_0_um_b": 27.98,
	"pm1_0_atm_b": 0.55,
	"p_2_5_um_b": 5.96,
	"pm2_5_atm_b": 2.29,
	"p_5_0_um_b": 2.95,
	"pm10_0_atm_b": 4.98,
	"p_10_0_um_b": 1.09,
	"p25aqic": "rgb(6,229,0)",
	"pm2.5_aqi": 14,
	"pm1_0_cf_1": 1.1,
	"p_0_3_um": 386.8,
	"pm2_5_cf_1": 3.45,
	"p_0_5_um": 111.82,
	"pm10_0_cf_1": 6.22,
	"p_1_0_um": 27.47,
	"pm1_0_atm": 1.1,
	"p_2_5_um": 6.93,
	"pm2_5_atm": 3.45,
	"p_5_0_um": 2.8,
	"pm10_0_atm": 6.22,
	"p_10_0_um": 1.15,
	"pa_latency": 245,
	"response": 201,
	"response_date": 1612480347,
	"latency": 1143,
	"key1_response": 200,
	"key1_response_date": 1612480340,
	"key1_count": 926363,
	"ts_latency": 604,
	"key2_response": 200,
	"key2_response_date": 1612480341,
	"key2_count": 931526,
	"ts_s_latency": 588,
	"key1_response_b": 200,
	"key1_response_date_b": 1612480343,
	"key1_count_b": 933105,
	"ts_latency_b": 577,
	"key2_response_b": 200,
	"key2_response_date_b": 1612480344,
	"key2_count_b": 932974,
	"ts_s_latency_b": 601,
	"wlstate": "Connected",
	"status_0": 2,
	"status_1": 2,
	"status_2": 2,
	"status_3": 2,
	"status_4": 2,
	"status_5": 2,
	"status_6": 2,
	"status_7": 0,
	"status_8": 2,
	"status_9": 2,
	"ssid": "IoT"
}

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Fri 05 Feb 2021 12:02 am
by BeaumarisWX
I'm gonna fourth that Ken, since I have one of these too.

Thing here in Tasmania is the EPA use a different Category for PM2.5 and uses (Rolling (1) One Hour Average).

I run 2 Pages on my site ;

Global US Categories : https://beaumaris-weather.com/wxAqPurple.php
Tasmanian EPA Categories : https://beaumaris-weather.com/wxAqPurpleAU.php

EPA Category Info : https://www.dhhs.tas.gov.au/publichealt ... airquality
TasPM25.PNG
Kind Regards,

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Fri 05 Feb 2021 12:08 am
by saratogaWX
mcrossley wrote: Thu 04 Feb 2021 5:50 pm Thanks Ken, and do we have a decode of those key names and values mean (apart from the obvious ones)?
Sure.. does the attached help??

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Fri 05 Feb 2021 12:28 am
by beteljuice
@Ken -

That github is all about using PurpleAir API, not talking to the sensor (which produces a serialzed .arr file with much less info)

example - plus unserialized (PHP)

Code: Select all

a:15:{i:1;d:1.62999999999999989341858963598497211933135986328125;i:25;d:2.319999999999999840127884453977458178997039794921875;i:10;d:2.779999999999999804600747665972448885440826416015625;s:2:"1b";d:2.089999999999999857891452847979962825775146484375;s:3:"25b";d:2.649999999999999911182158029987476766109466552734375;s:3:"10b";d:2.819999999999999840127884453977458178997039794921875;s:3:"acc";d:-1;s:4:"temp";d:66;s:3:"hum";d:67;s:4:"baro";d:-1;s:5:"1_24h";d:2;s:6:"25_24h";d:2;s:6:"10_24h";d:3;s:3:"mes";a:1:{i:2020083100;a:7:{s:5:"count";i:1;s:7:"total_1";d:1.62999999999999989341858963598497211933135986328125;s:8:"total_25";d:2.319999999999999840127884453977458178997039794921875;s:8:"total_10";d:2.779999999999999804600747665972448885440826416015625;s:8:"total_1b";d:2.089999999999999857891452847979962825775146484375;s:9:"total_25b";d:2.649999999999999911182158029987476766109466552734375;s:9:"total_10b";d:2.819999999999999840127884453977458178997039794921875;}}s:4:"used";s:1:"-";}

Array ( [1] => 1.63 
	[25] => 2.32 
	[10] => 2.78 
	[1b] => 2.09 
	[25b] => 2.65 
	[10b] => 2.82 
	[acc] => -1 
	[temp] => 66 
	[hum] => 67 
	[baro] => -1 
	[1_24h] => 2 
	[25_24h] => 2 
	[10_24h] => 3 
	[mes] => Array ( 
		[2020083100] => Array (
			[count] => 1 
			[total_1] => 1.63
			[total_25] => 2.32 
			[total_10] => 2.78 
			[total_1b] => 2.09 
			[total_25b] => 2.65 
			[total_10b] => 2.82
		) 
	)
	[used] => -
) 

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Sat 06 Feb 2021 12:33 pm
by andrea_iw2ntf
Yes, it would be great to be able to register your data. The PurpleAir sensor is becoming widely used around the world.

I also have the sensor for two years now.

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Mon 08 Feb 2021 8:02 am
by ConligWX
there is also API info on the PA website:

Getting Started PurpleAir API

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Mon 08 Feb 2021 8:40 am
by HansR
From what I understand from the prev post by @ConligWX, it is not an API for accessing the device itself, but merely an API to manipulate data from the PurplAir server where all devices gather. Is that correct? Is there no direct access to the device?

And beyond that: nobody reacted on my remark above about:
HansR wrote: Tue 02 Feb 2021 10:28 am device independent Air Quality datamodel is needed before adding more of that type of devices.
Do I have to interpret this lack of reaction as 'the datamodel will just expanded be with every AQ device'. That seems weird as the meteo stations do share tables and fields. Multiple meteo stations require multiple instances of CMX. Should multiple AQ stations not require the same?

Beyond that: AQ should not be treated as simple meteorological data. Is isn't. It is air content vs air flow.

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Mon 08 Feb 2021 10:53 am
by ConligWX
there is access directly to PA.

ipaddress
PAweb-584x987.jpeg

and

ipaddress/json
PAjson-584x864.jpeg

Re: Add PurpleAir sensor to list of AQI sensors?

Posted: Mon 08 Feb 2021 11:02 am
by HansR
Ok. Thanks.