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

App shows “-” instead of AQI #74

Open
kevin1 opened this issue Jul 20, 2021 · 4 comments
Open

App shows “-” instead of AQI #74

kevin1 opened this issue Jul 20, 2021 · 4 comments

Comments

@kevin1
Copy link

kevin1 commented Jul 20, 2021

Hi,

I noticed that aqi.wtf has been showing - for the AQI recently:

19945775-A6A7-433A-8F7B-605554444E1D

It is because the sensors are no longer returning the humidity:

aqi-wtf/app.js

Line 93 in 03e5090

let humidity = sensor.results[0].humidity;

Console output:

> sensor.results[0]
{ID: 37185, Label: "NBN - Bushwick and McKibbin", DEVICE_LOCATIONTYPE: "outside", THINGSPEAK_PRIMARY_ID: "843861", THINGSPEAK_PRIMARY_ID_READ_KEY: "88BKCTH44MUS6WL9", …}
> sensor.results[0].humidity 
undefined

the undefined humidity causes aqiFromPM to return a hyphen instead of the AQI calculation.

@skalnik
Copy link
Owner

skalnik commented Jul 22, 2021

Oooh weird! Thanks for the report. It still works for me, so seems that some sensors don't return this. We should definitely fail a bit more gracefully!

@kevin1
Copy link
Author

kevin1 commented Jul 27, 2021

@skalnik just for my own education, is it possible to do this calculation without humidity? I’m wondering what a good solution would be.

@danisyellis
Copy link
Contributor

It looks like the humidity is needed for the calculation using the EPA recommended corrections.
But the AQandU function is still in the codebase. Perhaps the best option would be if the sensor doesn't return the humidity, use the AQandU calculation instead (and note that when displaying the results).

@skalnik
Copy link
Owner

skalnik commented Aug 10, 2021

I think that's reasonable! Another idea would be cutting down the list of sensors just to those that have humidity?

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

3 participants