Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AQI numbers are dangerously misleading when one of the channels from the sensor is busted. #46

Closed
obra opened this issue Sep 8, 2020 · 5 comments

Comments

@obra
Copy link
Collaborator

obra commented Sep 8, 2020

A friend in Seattle reported that aqi.wtf didn't match purpleair.
image
image

It appears that this sensor has one "degraded" channel, so it's only getting AQI data from the B sensor. I believe aqi.wtf is doing the wrong thing when averaging the good and bad channels.

The bad sensor is at https://www.purpleair.com/map?opt=1/i/mAQI/a0/cC1&select=20759#13.18/47.5699/-122.39299

Raw sensor data from what purpleair's map is currently seeing is inline below:

{
  "mapVersion": "0.18",
  "baseVersion": "7",
  "mapVersionString": "",
  "results": [
    {
      "ID": 20759,
      "Label": "North Admiral",
      "DEVICE_LOCATIONTYPE": "outside",
      "THINGSPEAK_PRIMARY_ID": "644662",
      "THINGSPEAK_PRIMARY_ID_READ_KEY": "R3BQTJCIEGGCCLW5",
      "THINGSPEAK_SECONDARY_ID": "644665",
      "THINGSPEAK_SECONDARY_ID_READ_KEY": "C9HWY21W209QHQAF",
      "Lat": 47.586074,
      "Lon": -122.383009,
      "PM2_5Value": "0.0",
      "LastSeen": 1599604445,
      "Type": "PMS5003+PMS5003+BME280",
      "Hidden": "false",
      "DEVICE_BRIGHTNESS": "15",
      "DEVICE_HARDWAREDISCOVERED": "2.0+BME280+PMSX003-B+PMSX003-A",
      "Version": "6.01",
      "LastUpdateCheck": 1599601323,
      "Created": 1544041613,
      "Uptime": "540598",
      "RSSI": "-75",
      "Adc": "0.0",
      "p_0_3_um": "0.0",
      "p_0_5_um": "0.0",
      "p_1_0_um": "0.0",
      "p_2_5_um": "0.0",
      "p_5_0_um": "0.0",
      "p_10_0_um": "0.0",
      "pm1_0_cf_1": "0.0",
      "pm2_5_cf_1": "0.0",
      "pm10_0_cf_1": "0.0",
      "pm1_0_atm": "0.0",
      "pm2_5_atm": "0.0",
      "pm10_0_atm": "0.0",
      "isOwner": 0,
      "humidity": "17",
      "temp_f": "81",
      "pressure": "1011.24",
      "AGE": 1,
      "Stats": "{\"v\":0.0,\"v1\":0.0,\"v2\":0.0,\"v3\":0.0,\"v4\":0.0,\"v5\":0.0,\"v6\":0.0,\"pm\":0.0,\"lastModified\":1599604445640,\"timeSinceModified\":119967}"
    },
    {
      "ID": 20760,
      "ParentID": 20759,
      "Label": "North Admiral B",
      "THINGSPEAK_PRIMARY_ID": "644666",
      "THINGSPEAK_PRIMARY_ID_READ_KEY": "KQZOSQYCSX6TN5HK",
      "THINGSPEAK_SECONDARY_ID": "644667",
      "THINGSPEAK_SECONDARY_ID_READ_KEY": "TFLYCY302WYLGZHH",
      "Lat": 47.586074,
      "Lon": -122.383009,
      "PM2_5Value": "53.98",
      "LastSeen": 1599604445,
      "Hidden": "false",
      "Created": 1544041613,
      "Adc": "0.00",
      "p_0_3_um": "10503.0",
      "p_0_5_um": "3068.66",
      "p_1_0_um": "386.09",
      "p_2_5_um": "24.43",
      "p_5_0_um": "5.84",
      "p_10_0_um": "0.39",
      "pm1_0_cf_1": "61.27",
      "pm2_5_cf_1": "81.91",
      "pm10_0_cf_1": "85.59",
      "pm1_0_atm": "40.12",
      "pm2_5_atm": "53.98",
      "pm10_0_atm": "66.71",
      "isOwner": 0,
      "AGE": 1,
      "Stats": "{\"v\":53.98,\"v1\":54.53,\"v2\":54.97,\"v3\":56.62,\"v4\":55.3,\"v5\":29.27,\"v6\":9.6,\"pm\":53.98,\"lastModified\":1599604445641,\"timeSinceModified\":119967}"
    }
  ]
}
@skalnik
Copy link
Owner

skalnik commented Sep 9, 2020

Ooh, yeah this is definitely a problem. I reformatted that JSON a bit nicer and nothing jumps out as easy to detect as "degraded" other than all of the pm_n_n values being 0.

@skalnik
Copy link
Owner

skalnik commented Sep 9, 2020

Maybe it's worth ignoring the overall PM2_5 value from a sensor if it's out of a specific range or if it's 0 and the other value is more than like 3 away?

@obra
Copy link
Collaborator Author

obra commented Sep 9, 2020 via email

@obra
Copy link
Collaborator Author

obra commented Sep 10, 2020

End-user reports that the new code appears to work. (Though comments that the color scheme doesn't seem to match PA)

@obra obra closed this as completed Sep 10, 2020
@skalnik
Copy link
Owner

skalnik commented Sep 10, 2020

(Though comments that the color scheme doesn't seem to match PA)

Yeah I think this is tracked over in #5. PA does a nice gradient adjustment of the color, where as we just have the one specific color per level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants