home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.82k stars 28.95k forks source link

Airly doesn't find station #33153

Closed metbril closed 3 years ago

metbril commented 4 years ago

The problem

When I add the integration through the UI using my API key and my home location, I expect Airly to find the nearest station. However, it only produces an error "Geen Airly meetstations in dit gebied." (No Airly stations in this area). When I move to the Airly developer area and try the API, I can find the nearest station to me:

[
  {
    "id": 10189,
    "location": {
      "latitude": 51.914999,
      "longitude": 4.480289
    },
    "address": {
      "country": "Netherlands",
      "city": "Rotterdam",
      "street": "Baan",
      "number": "25",
      "displayAddress1": "Rotterdam",
      "displayAddress2": "Baan"
    },
    "elevation": 5.35,
    "airly": false,
    "sponsor": {
      "id": 576,
      "name": "EEA",
      "description": "Source",
      "logo": "https://cdn.airly.eu/logo/eea.png",
      "link": "https://www.eea.europa.eu"
    }
  }
]

When I replace my home coordinates with the lat/lon of the station itself, it produces the exact same error. So it won't find any station for me. Making the integration unusable.

Environment

Problem-relevant configuration.yaml

n/a. using the integrations UI.

Traceback/Error logs

Geen Airly meetstations in dit gebied.

Additional information

n/a

probot-home-assistant[bot] commented 4 years ago

Hey there @bieniu, mind taking a look at this issue as its been labeled with a integration (airly) you are listed as a codeowner for? Thanks!

bieniu commented 4 years ago

Airly API responds There are no Airly sensors in this area yet when I use your coordinates.

curl -X GET \
>     --header 'Accept: application/json' \
>     --header 'apikey: apikey' \
>     'https://airapi.airly.eu/v2/measurements/point?lat=51.914999&lng=4.480289'
{"current":{"fromDateTime":"2020-03-22T15:52:24.715Z","tillDateTime":"2020-03-22T16:52:24.715Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},"history":[{"fromDateTime":"2020-03-21T16:00:00.000Z","tillDateTime":"2020-03-21T17:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-21T17:00:00.000Z","tillDateTime":"2020-03-21T18:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-21T18:00:00.000Z","tillDateTime":"2020-03-21T19:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-21T19:00:00.000Z","tillDateTime":"2020-03-21T20:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-21T20:00:00.000Z","tillDateTime":"2020-03-21T21:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-21T21:00:00.000Z","tillDateTime":"2020-03-21T22:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-21T22:00:00.000Z","tillDateTime":"2020-03-21T23:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-21T23:00:00.000Z","tillDateTime":"2020-03-22T00:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T00:00:00.000Z","tillDateTime":"2020-03-22T01:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T01:00:00.000Z","tillDateTime":"2020-03-22T02:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T02:00:00.000Z","tillDateTime":"2020-03-22T03:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T03:00:00.000Z","tillDateTime":"2020-03-22T04:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T04:00:00.000Z","tillDateTime":"2020-03-22T05:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T05:00:00.000Z","tillDateTime":"2020-03-22T06:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T06:00:00.000Z","tillDateTime":"2020-03-22T07:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T07:00:00.000Z","tillDateTime":"2020-03-22T08:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T08:00:00.000Z","tillDateTime":"2020-03-22T09:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T09:00:00.000Z","tillDateTime":"2020-03-22T10:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T10:00:00.000Z","tillDateTime":"2020-03-22T11:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T11:00:00.000Z","tillDateTime":"2020-03-22T12:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T12:00:00.000Z","tillDateTime":"2020-03-22T13:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T13:00:00.000Z","tillDateTime":"2020-03-22T14:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T14:00:00.000Z","tillDateTime":"2020-03-22T15:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T15:00:00.000Z","tillDateTime":"2020-03-22T16:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]}],"forecast":[{"fromDateTime":"2020-03-22T16:00:00.000Z","tillDateTime":"2020-03-22T17:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T17:00:00.000Z","tillDateTime":"2020-03-22T18:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T18:00:00.000Z","tillDateTime":"2020-03-22T19:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T19:00:00.000Z","tillDateTime":"2020-03-22T20:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T20:00:00.000Z","tillDateTime":"2020-03-22T21:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T21:00:00.000Z","tillDateTime":"2020-03-22T22:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T22:00:00.000Z","tillDateTime":"2020-03-22T23:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-22T23:00:00.000Z","tillDateTime":"2020-03-23T00:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T00:00:00.000Z","tillDateTime":"2020-03-23T01:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T01:00:00.000Z","tillDateTime":"2020-03-23T02:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T02:00:00.000Z","tillDateTime":"2020-03-23T03:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T03:00:00.000Z","tillDateTime":"2020-03-23T04:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T04:00:00.000Z","tillDateTime":"2020-03-23T05:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T05:00:00.000Z","tillDateTime":"2020-03-23T06:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T06:00:00.000Z","tillDateTime":"2020-03-23T07:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T07:00:00.000Z","tillDateTime":"2020-03-23T08:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T08:00:00.000Z","tillDateTime":"2020-03-23T09:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T09:00:00.000Z","tillDateTime":"2020-03-23T10:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T10:00:00.000Z","tillDateTime":"2020-03-23T11:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T11:00:00.000Z","tillDateTime":"2020-03-23T12:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T12:00:00.000Z","tillDateTime":"2020-03-23T13:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T13:00:00.000Z","tillDateTime":"2020-03-23T14:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T14:00:00.000Z","tillDateTime":"2020-03-23T15:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]},{"fromDateTime":"2020-03-23T15:00:00.000Z","tillDateTime":"2020-03-23T16:00:00.000Z","values":[],"indexes":[{"name":"AIRLY_CAQI","value":null,"level":"UNKNOWN","description":"There are no Airly sensors in this area yet.","advice":null,"color":"#999999"}],"standards":[]}]}

On Airly page your coordinates have the same result.

image

This is not an integration issue.

metbril commented 4 years ago

Trying from this page

https://developer.airly.eu/api

with the coordinates shows the result. That's strange.

maraswrona commented 4 years ago

Hi folks

This is Marek from Airly. This behavior is intended. At the moment the /v2/measurements/point operation returns interpolated measurement from Airly sensors only. National stations are not considered when calculating the result.

This may change in the future though.

Cheers

DCzajkowski commented 4 years ago

The front-end of the developer portal makes requests to the API the same way every other client does, so there cannot be any differences in API outputs.

The difference you are seeing is of different sort. There are two endpoints: /v2/measurements/point and /v2/measurements/nearest. The point is for air pollution in that exact point. The nearest finds the nearest available measurement for the specified point (up to N kilometers, specified in the query).

You are using the nearest, while this integration uses point. The problem is, that — although not specified anywhere — the point endpoint returns interpolated values only for Airly sensors, while the one you are trying to obtain is an EEA one.

Proposed solutions:

bieniu commented 4 years ago

In my opinion integration, by default, should present the same data as the Airly website. nearest method can only be an option.

stale[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

saxn-paule commented 3 years ago

Is there a solution for this issue? I have exactly the same problem.

bieniu commented 3 years ago

If you get error No Airly stations in this area that's not an issue. You can use other coordinates closer to the existing measuring station.

saxn-paule commented 3 years ago

I used exactly the coordinates of the station. You can try it with this station:

{
        "id": 9541,
        "location": {
            "latitude": 51.036105,
            "longitude": 13.730205
        },
        "locationId": 9541,
        "address": {
            "country": "Germany",
            "city": "Dresden",
            "street": "Schnorrstraße",
            "number": null,
            "displayAddress1": "Dresden",
            "displayAddress2": "Schnorrstraße"
        },
        "elevation": 120.77,
        "airly": false,
        "sponsor": {
            "id": 548,
            "name": "Umweltbundesamt",
            "description": "Source",
            "logo": "https://cdn.airly.eu/logo/UmweltBundesamt.png",
            "link": "https://www.umweltbundesamt.de",
            "displayName": "Umweltbundesamt"
        }
    }
metbril commented 3 years ago

Exactly @saxn-paule. That's what I already mentioned in my initial post:

When I replace my home coordinates with the lat/lon of the station itself, it produces the exact same error. So it won't find any station for me.

metbril commented 3 years ago

@frenck This issue isn't resolved. Would you mind re-opening it?

bieniu commented 3 years ago

@saxn-paule Airly says there are no measuring station in these coordinates. Report the problem to Airly.

image

saxn-paule commented 3 years ago

image

bieniu commented 3 years ago

@metbril This isn't an issue of the integration. This is a feature request (using nearest method).

saxn-paule commented 3 years ago

I also tried the integration for other cities. Also for those that have only one sensor in town. Same behavior.

bieniu commented 3 years ago

Please post coordinates.

saxn-paule commented 3 years ago

https://airly.eu/map/en/#51.119514,13.675005,i9228 https://airly.eu/map/en/#52.146264,14.638165,i9556 https://airly.eu/map/en/#51.897598,14.057064,i9170

image

image

image

bieniu commented 3 years ago

Those are links for measure stations, not for coordinates. Use URL without station ID: https://airly.eu/map/en/#52.146264,14.638165

Ask Airly why they work that way. It's not an integration issue.

saxn-paule commented 3 years ago

Could you please provide example coordinates that definitely work. It doesn't matter what I try. No coordinates work for me.

bieniu commented 3 years ago

https://airly.eu/map/en/#52.4943480883,13.4283835095

saxn-paule commented 3 years ago

Well, I see the issue. It only works very close to round stations. If there are only square stations, nothing will be found.

image

Do you know, what's the difference?

bieniu commented 3 years ago

I think it's related to this https://github.com/home-assistant/core/issues/33153#issuecomment-612427094

saxn-paule commented 3 years ago

Okay, then this integration isn't usable in most cases. Thx for the reply.