New 'Air pollution' component for Gismo

New ‘Air pollution’ component has been added to Gismo.
It shows the current air pollution indices/gasses for a defined location and radius.

The following 9 indices/gasses are available:

  • Air Quality Index (AQI) - compound index created from values of bellow mentioned gasses and particles.
  • Particulate matter 10<=μm (PM10)
  • Particulate matter 2.5<=μm (PM2.5)
  • Sulphur dioxide (SO2)
  • Nitrogen monoxide (NO)
  • Nitrogen dioxide (NO2)
  • Carbon monoxide (CO)
  • Ozone (O3)
  • Ammonia (NH3)

Download the example, and set the boolean toggle to ‘True’.

Example: LA Long Beach, USA - Nitrogen monoxide (NO) data:

7 Likes

Where is the data from?

Nice work ! Thanks.

1 Like

Hi,
The example file seems not work here.
What should I do?

Hi @user454 ,
Can you post the screenshot of the “out” output?

Hi @user454 ,
i meant the screenshot of the “out” output. Thank you.

Sorry ,I misunderstanded your request.

1 Like

Thank you @user454
This is my mistake.
Add # at the beginning of the line 100. That should solve the error:

Thanks.
It works now.

1 Like

Thank you for testing @user454 !
You can change different pollution gasses/indices, by setting the ‘_analysisType’ input from 0 to 8.

1 Like

Hi @user454
I already made a change to the upper example file, and the component’s source code.
So other users should not get this error from today. Thank you once again for the testing.

Hi @martynjhogg ,
Data is downloaded from Openweathermap: https://openweathermap.org
According to their website:

We collect and process weather data from different sources such as global and local weather models, satellites, radars and a vast network of weather stations. Data is available in JSON, XML, or HTML format.

2 Likes

Hi @djordje
I get this far, but no other output.
I updated to the latest ghuser file from the github.


Rhino8

Hi @martynjhogg
Double click on the python component, and on the line 336 type:

print jsonLink

It should print a few of the api calls into the ‘out’ parameter.

Copy just one of them (any), and paste it into your internet browser.
If you could share the screenshot of the result, it would be great. You can “paint over” your APIkey part in the screenshot.

Thanks for the support!

When I follow those instructions and paste the api call into a browser I get the following error message…

{“cod”:401, “message”: “Invalid API key. Please see Frequently Asked Questions - OpenWeatherMap for more info.”}

I’ve used the API key I was using for the Gizmo components in previous definitions.

Does this need a new API key for OpenWeatherMap ?

Hi @martynjhogg ,
Thank you for the testing too.
Then we found the reason - the API key is wrong.

For the previous Gismo components, we used OpenTopography APIkey - which is for terrain.
Now, for the first time, we need OpenWeatherMap one. Get it at:

https://home.openweathermap.org/users/sign_in

But I agree with you, that I should differentiate between the two API keys in their names.

1 Like