Air Quality Binding - looking for testers

There’s no need to provide me the API key - just make sure it’s pasted correctly.
If it comes to the coordinates - yes, you can PM me these and I will try to receive data with it.
Are you sure the coords are written in the following convention?
12.345;55.666
or
12.345,55.666

Thanks!

You need to delete " characters from the Location parameter.
Worked for me :slight_smile:

The description has them included so it led you to the problem. I will fix that soon, so there’s no more confusion.

Thank you for reporting the issue! Cheers

1 Like

:dizzy_face: Something so simple…

Thanks! Really Appreciate your time!

Great binding. Already configured, works properly. Good job!

Noticed a few errors this morning:

[WARN ] [airquality.handler.AirQualityHandler] - Error running aqicn.org (Air Quality) request: Server returned HTTP response code: 502 for URL: http://api.waqi.info/feed/geo:XX.XXXX;XX.XXXX/?token=XXXXXXXXXXXXXXXXXXXX

then

[WARN ] [airquality.handler.AirQualityHandler] - Error parsing aqicn.org (Air Quality) response: java.lang.NumberFormatException: Expected an int but was 2.4 at line 1 column 339 path $.data.iaqi.co.v

[WARN ] [airquality.handler.AirQualityHandler] - Error parsing aqicn.org (Air Quality) response: java.lang.NumberFormatException: Expected an int but was 2.6 at line 1 column 337 path $.data.iaqi.co.v

[WARN ] [airquality.handler.AirQualityHandler] - Error parsing aqicn.org (Air Quality) response: java.lang.NumberFormatException: Expected an int but was 2.7 at line 1 column 337 path $.data.iaqi.co.v

I suspect this is related to the format of data received for CO. From my raw json response:
"co":{"v":2.7}

Same here.

10:34:39.085 [DEBUG] [airquality.handler.AirQualityHandler] - aqiResponse = {"status":"ok","data":{"aqi":64,"attributions":[{"url":"http://www.luchtmeetnet.nl/","name":"RIVM - Rijksinstituut voor Volksgezondheid en Milieum, Landelijk Meetnet Luchtkwaliteit"}],"city":{"geo":[51.8xxxx,4.5xxxx],"name":"Hogeweg, Ridderkerk","url":"http://aqicn.org/city/netherland/ridderkerk/hogeweg/"},"dominentpol":"pm25","iaqi":{"h":{"v":61},"no2":{"v":28.1},"o3":{"v":4.4},"p":{"v":1014},"pm10":{"v":28},"pm25":{"v":64},"t":{"v":6.14}},"time":{"s":"2017-01-28 10:00:00","tz":"+01:00","v":1485597600}}}
10:34:39.087 [WARN ] [airquality.handler.AirQualityHandler] - Error parsing aqicn.org (Air Quality) response: java.lang.NumberFormatException: Expected an int but was 28.1 at line 1 column 366 path $.data.iaqi.no2.v

And here.

16:26:42.662 [WARN ] [airquality.handler.AirQualityHandler] - Error parsing aqicn.org (Air Quality) response: java.lang.NumberFormatException: Expected an int but was 0.1 at line 1 column 343 path $.data.iaqi.co.v

So I guess we need to wait for a fix.

Thank you for reporting the issues. Looks like the API changed today :open_mouth:
I’ll work on it in the next few days:

Quick update - as I thought, the API of WAQI changed. Sadly, without any notice or versioning.
So for now:

  • All measurements are kept as Float, not Integer values
  • Seems like there’s no longer Station ID in the payload :frowning:
  • There’s one additional value called dominentpol - I’m not sure what to do with this yet :wink:

I’m working on the bugfixes now. I’ll keep you updated!

Thanks again!
Kuba

B[quote=“kubawolanin, post:30, topic:20756”]
There’s one additional value called dominentpol - I’m not sure what to do with this yet :wink:
[/quote]

Probably ‘dominant pollutant’, the value that determines the index?

Looks lik there are some new values, too: h and p?

There is a new version 1.1.0 of the API in the docs

http://aqicn.org/json-api/doc/

h and p values were there all the time - it’s humidity and pressure.
And the version was 1.1.0 all the time IIRC :wink:

@PawelGrzembka @AndrewZ the issue is now resolved in the latest build.
Note that due to the API change, you need to remove Station ID item from your configs.
The safest approach would be to reinstall the Karaf bundle, but it should work without it as well.

Thank you!

1 Like

@kubawolanin all seems to be working properly, thank you!

The page now indicates 1.2.0: http://aqicn.org/json-api/doc
However I do not see the version number in any of the example requests/responses. If you were able to fetch this API version, would it make sense to verify it against the latest known version? This way you could at least generate a warning.

they are updating the API like crazy. This weekend the version was at 1.1.0 and they have now upgraded again. The 1.1.0 docs are not even available anymore.

@kubawolanin may I suggest an enhancement?
Currently the binding is using geo coordinates only, but the API itself allows to also query by station id (idx). Will be good to have this option in the binding configuration, this will allow to stick with the specific station if necessary. Thanks!

Hey Andrew,

I’ve just implemented that feature!

I’ve updated my first post on GitHub with the latest build.

What’s new:

Thank you! :slight_smile:

Just updated, all seems to be working properly. Thanks a lot, Kuba!

[WARN ] [airquality.handler.AirQualityHandler] - Error running aqicn.org (Air Quality) request: Configuration is incorrect

Another API change? Unfortunately I have no earlier raw json response to compare with.