pawkakol1 / worlds-air-quality-index

HACS World's Air Quality Index integration from waqi.info
43 stars 12 forks source link

Server error on adding WAQI integration using station ID #16

Closed LinusHoppe closed 2 years ago

LinusHoppe commented 2 years ago

environment:

steps to reproduce:

  1. Add WAQI integration, select "by station ID"
  2. insert Token, station 62731 and a name
  3. Klick "send" config

Error & Log: It just came back with server error, giving no further details. Log level is set to debug, but it should give more details about the server error.

server error

2022-06-13 08:43:09 WARNING (SyncWorker_5) [homeassistant.loader] We found a custom integration worlds_air_quality_index which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-06-13 08:44:56 DEBUG (SyncWorker_1) [custom_components.worlds_air_quality_index.waqi_api] Updating WAQI sensors
pawkakol1 commented 2 years ago

Your station ID is not supported by WAQI's API, so this integration won't be able to integrate it. I wrote that in ReadMe:

Notice: waqi.info API supports stations with IDs between 1 and 13837 only. If your station has ID greater than 13837 it won't be able to add using station ID method nor geolocalized coordinates method. waqi.info website shows (on map) much more stations, than are supported by waqi.info API. All others stations are integrated with WAQI map from others websites. In the future waqi.info API would be developed, and there would be more supported stations, you can always check if your station is supported. You just need to copy below link, paste to the URL of web browser, change number of interested station, and paste your token insted {{token}}

https://api.waqi.info/feed/@13837/?token={{token}}

Web browser will receive some data, if station is supported or "Unknown ID" message, if it doesn't.

Below my try with Postman image

LinusHoppe commented 2 years ago

@pawkakol1: Thanks for sharing the information. Can you please show a short message to the user and maybe point to some readme explanation instead of server error?