I’ve been following this thread for a long time and finally got a configuration working well for my local sensor. Some additions from others I’ve seen:
Everything in a YAML file so it is easy to tweak and edit.
All of the interesting sensors have unique_ids so that they are easy to use in the UI.
Nice Unicode strings for the units and friendly names (e.g. µg/m³)
US EPA Smoke conversion provided as a separate sensor.
Temperature and Humidity offsets applied as documented by Purple Air.
Temperature smoothing statistics sensor (because mine seems to be a bit wonky).
I noticed that you get noise (your words); there are at least two different pages for json info for the purpleair. I will have to check when I get home (or look around on here) what it actually is but I think it is “\avg” which will give you the 10 min running average. I use the 10 min running average for all my sensors.
Edit Why are you using slightly different correction constants for you EPA correction?
From the EPA:
@GlennHA this is what my raw temperature readings looked like. Noisy, but not really random, which is why I chose to take the trailing max vs a trailing average.
I went off the link you had in the yaml which is not the same as above. You linked to the 2018 version instead of the 2020 version in that section of the yaml on your repository (just update to the link above).
I read that paper and from my personal experiance with looking at Purple Air map and the EPA AirNow map when compared to just going outside and breathing that the purple air is more acurate than the AirNow map. Also recently for some non-credible reason, the AirNow map forbids itself being used in an iFrame. The paper says that PurpleAir reports correct 80% of the time and only over reports 20% of the time (and only by 1AQI); my experience is that the AirNow map drastically under-reports. There were days when there was no visibility due to smoke from wildfires over a hundred miles away and the AirNow map showed my area as green. I also live less than 20 miles from an EPA test site at an airport.
Do you see any real difference with the calculations for the PurpleAir AQI and the ‘corrected’ AQI?
Are you sure? Maybe I’m drowning in PDFs, but I think the one I had in the YAML and the one I linked above are both the same (ID 349513 from the URL link) and are titled 4/2020. In either case, I cleaned up the one in the YAML to remove the extra junk in the URL from the comment.
I didn’t really notice a difference last year. But my house is in a hilly/mountainous area where it is hard to compare to anything nearby and wide area values aren’t usable.
If you have a dew point value calculation, I’m all ears!
Wow, I never realized that the sensor had dew point and pressure.
But I went down a bit of a rabbit hole. I had a hunch that the built-in dew point was based on the raw values without the suggested corrections. I did some math and confirmed that to be the case. I also realized that the simplified formula was way off for the currently dry air I’m experiencing. So, I implemented a more complete formula. I don’t know if this is right, but it seems to produce a reasonable value.
I would also add all the sensors to your yaml, even if you don’t use them, just to help keep track of them. I’m referring to wifi signal, memory fragmentation, etc…; I have them and just comment out the ones I don’t see a need for.
I have a Weather Station and I find that that, at least for my location, the dewpoint from PurpleAir and my simplified formula work fairly well.
I also like the description of air quality, which is at the bottom of my yaml, this makes Text-To-Speech (TTS) and phone notifications more useful. If lights are on in a room then the speaker will anouce any change in air quality from one band to another. Everything is self hosted, my speakers are just RPi with a USB speaker running KODI. I use MaryTTS for the speech and this setup has been working great for a few years now.
I pulled some of my calculations out of my PurpleAir setup once I got my Tempest Weather Station but you might find some useful calculations here: https://github.com/briis/hass-weatherflow2mqtt
I’m attempting to locally import multiple PurpleAir’s into HA, but I seem to be unable to figure out why this code is not working. The code works fine if I try to import just the humidity from one sensor, but if I try adding a second one like shown below, it fails to work.
I ultimately ended up using Home Assistant’s NodeRed integration to get both sensors working. I spent many countless hours setting this NodeRed configuration up so I figured I would post it here to save someone the time in the future if they plan to use something like this.
To anyone interested in purchasing an indoor and an outdoor sensor, I would highly recommend purchasing two outdoor sensors instead of an indoor sensor and an outdoor sensor. The indoor sensor is not nearly as accurate as the outdoor sensor.
I’ll be returning my indoor sensor and replacing it with an outdoor sensor. So I’ll have 2 outdoor sensors, but one will be used indoors and one will be used outdoors.
No worries GlennHA, I did the same thing. I personally contacted PurpleAir and they were more than willing to exchange the indoor sensor for the outdoor sensor. It came out to about an extra $60 that I had to pay them for the price difference between the two sensors which I believe is completely worth it.
I wonder if there is a way to remove some majorTicks but still have the colors fitting to the ticks (and as I assume the pointer pointing to the correct values)?
My idea is to strech the lower intervals and compress the bigger intervals because nobody cares if it is 360 or 390.
Did so.
But why are the colors not fitting to the numbers or vice versa?
And the pointer seems to be wrong, too.
In the picture above the 50 is in the yellow area although it should be green.
The major ticks must be equally apart, so you can’t skip numbers. It would appear you can in the documentation, but in practice I’ve not ever been able to get it to work without equidistant numbers.