kalanda / homeassistant-aemet-sensor

AEMET integration for Home Assistant
MIT License
21 stars 24 forks source link

Invalid response #10

Closed marcgarciamarti closed 4 years ago

marcgarciamarti commented 4 years ago

Hi,

I've followed the instructions and there is no way I can manage to make this integration to work. I keep getting this error:

[custom_components.aemet.AemetApi] Invalid response: 200 

prior to opening this issue, I've changed the API key and the Station to no avail.

Thanks

kalanda commented 4 years ago

You need to get your api_key and find the nearest station_id at https://opendata.aemet.es/ in order to finish the configuration.

IMPORTANT NOTE: You have to get the station_id from "Observación convencional" => "Datos de observación" stations. It isn't the same that in "Climatologías diarias".

marcgarciamarti commented 4 years ago

You need to get your api_key and find the nearest station_id at https://opendata.aemet.es/ in order to finish the configuration.

IMPORTANT NOTE: You have to get the station_id from "Observación convencional" => "Datos de observación" stations. It isn't the same that in "Climatologías diarias".

Thanks for answering @kalanda ! I've done that already. I've actually even requested a new AP key prior to creating this issue.

This is my station id

aemet_station_id: 0076 (Barcelona Airport)

if you want I can share with you privately my API key. I'm at a loss. AEMET OpenData site seems to confirm my pair is working well. See snapshot:

Screen Shot 2020-03-22 at 11 34 21

and if I open the first link I see this:

https://opendata.aemet.es/opendata/sh/02beb6aa Screen Shot 2020-03-22 at 11 36 03

Please note that I’m running hacs version 1.2

kalanda commented 4 years ago

@marcgarciamarti I found the issue with the station_id. Almost all the station have some letters into the ID, but this one (0076) has only numbers and for some reason HA is transforming this number to string in a wrong way. Just wrap the station id value with double quotes and will work fine. I just test it with your station id.

kalanda commented 4 years ago

I mean like this:

sensor:
  - platform: aemet
    name: "BCN Airport"
    api_key: "your apikey"
    station_id: "0076"
    monitored_conditions:
      - temperature
      - humidity
      - pressure
      - precipitation
      - snow
      - visibility
      - wind_speed
      - wind_max_speed
      - wind_bearing
marcgarciamarti commented 4 years ago

@kalanda many thanks for your prompt answer. Will try that ASAP. Just wondering if using the secrets.yaml file implies any additional transformation.

One additional question: near to where I live I know there are other stations not owned by AEMET. Do you happen to know any local service like yours that may allow me to access that data? I see that one fellow HA user is working on enabling integration with meteocat, and that will be awesome when it is available but just wondering if you now some other way to access other local weather stations...

kalanda commented 4 years ago

Cool, I hope it works for you. About the meteocat integration question, I haven't any clue about it.

marcgarciamarti commented 4 years ago

One last question: do you happen to know how to return the wind speed reported by your component in m/s instead of km/h? I guess that it has not been your decision but rather how AEMET publishes its data but just wondering if you happen to know how to do that.