Starting last week our sensor and our neighbors’ sensor give completely wrong readings on the widget. I’ve recopied the widget code to our website, and it doesn’t change anything.
Right now, the map shows our AQI at 20, but the widget for it shows it at 154. Our neighbors’ sensor is showing 25 on the map, but their widget is showing 335.
The Widget captures the current map settings when you copy the code. Perhaps you had the map set to a different value when you copied it? A number around 200 at AQI 20 sounds like the 0.5μm particle count.
I’ll look, but I’ve been using these widgets for several years, and they ALWAYS match what is on the map. I’ve not interacted with my account or the map since I set it up.
Right now, our sensor reads 17 on both the map and the widget.
Our neighbor’s readings are 23 for the map and 163 for the widget.
But yesterday, both widgets were wildly off from the map, like 15x higher on the widget than the map.
Could you provide the widget code you’re using for both your and your neighbor’s sensors? This could be in a reply here or in an email to contact@purpleair.com.
Thank you for your email. We’re including the solution here as well in case it’s useful to other community members.
The Cause of the Problem
It appears that both sensors had a channel automatically downgraded by our systems, but the widgets didn’t properly reflect this. I’ve sent this to our development team so the issue can be resolved when they next work on the widget.
The Solution
We have manually downgraded the high-reading channel. This causes the widgets to display data from the other channel and should make them usable again. These manual downgrades will remain until removed by PurpleAir staff, so let us know if the readings improve after performing sensor maintenance or replacing the laser counters.
I just updated my code to adapt to the new widget behavior. In the process I discovered 3 bugs / errors.
My widget specified as SEA_LEVEL_PRESSURE reports a numerically wrong result (much lower than correct map result and much above air pressure). Note: Similar widgets for US_EPA_AQI and ESTIMATED_RELATIVE_HUMIDITY are numerically correct).
Regardless of the widget’s data specification, pressing “Purple Air Map” ignores this specification and always shows the US_EPA_AQI result. For example, a user calling up a map for estimated temperature would like to see, well, temperature - without having to go through the trouble of re-selecting temperature on the map. (I think I remember Purple Air correcting this poor behavior in the past, but it’s back.)
The parameter ESTIMATED_TEMERATURE_FAHRENHEIT is incorrectly spelled, lacking the “P”. While the misspelled parameter works, it cost me some unnecessary debugging time.