-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error retrieve data from AEMET #1
Comments
Hola, I think your api_key is too short, mine is about 292 characters. You should go to: https://opendata.aemet.es/centrodedescargas/inicio There you should click on button "Solicitar" in "Obtención de API key" section and in the next screen you will enter your email. You should receive an email from [email protected] with your api key. As you can see... it is a quite long text. Please review your email (spam folder too) and check that you received the email with your api key. Un saludo. |
Sorry, i do exactly this and my api_key i receive from AEMET email have 285 characters |
As you can see on error reported... your key is too small.
My old key was 292 characters and the new one that I just request is also 292 characters. Are you sure you copied whole api key? |
i dont know why i received an email from [email protected] with api_key with 285 characters, i make me crazy, but i sure i copy all characters, paste it on notepad++ and i see "col 285" i repeat proccess , receive new diferent key but same size. dont worry, i try other thinks, and posted it later |
I will try with other mail address to see if this key length depends on your email. For sure, error message is regarding key length. I will improve code to trap this error message and get a better user experience. |
i try with other email address and now 282 characters, 3 characters less, my new address have 3 characters less than the other I think email address is in the characters to the api key |
Now i try with other address, and now i have 298 characters, and i receive same ERROR |
I think is possible the error is : Max retries exceeded with url: /opendata/api/observacion/convencional/todas?api_key=xx |
Hola, Cambio al castellano que quizás estemos más cómodos. English follows. ¿Puedes realizar la siguiente prueba? Accede a la url: https://opendata.aemet.es/opendata/api/observacion/convencional/todas?api_key=***pon aquí tu api_key*** Entonces te tendría que devolver algo similar a esto: {
"descripcion" : "exito",
"estado" : 200,
"datos" : "https://opendata.aemet.es/opendata/sh/a0ac0bc0",
"metadatos" : "https://opendata.aemet.es/opendata/sh/55c2971b"
} Indícame qué te muestra a ti. Sospecho que no es un Can you do the following test? Go to the url: https://opendata.aemet.es/opendata/api/observacion/convencional/todas?api_key=***put your api key here*** Then you' d have to get something similar to that: {
"descripcion" : "exito",
"estado" : 200,
"datos" : "https://opendata.aemet.es/opendata/sh/a0ac0bc0",
"metadatos" : "https://opendata.aemet.es/opendata/sh/55c2971b"
} Tell me what it shows you. I suspect it is not a |
Mucho mas comodo, jejeje Recibo un "exito" 200, desde el movil, tengo que probar en hass con un curl o algo asi pero me llevara mas tiempo porque no recuerdo la instrccion exacta { I receive 200 exito, in my phone, i try in my hass with curl and post it |
Si usando la API_KEY recibes una contestación correcta con un Voy a revisar el código por si puedo detectar el error. |
Buenas, he realizado varias pruebas y si utilizo "curl" recibo el mismo error, he buscado por internet y he encontrado esto:
, parece que a partir de una versión de openssl no se puede usar curl para https, he probado a realizar la llamada con wget y ahora si me devuelve un codigo 200 de "exito"
cualquier avance me cuentas, gracias por todo Any progress tell me, thanks for everything |
Creo que lo he resuelto, he modificado la siguiente funcion:
le he añadido el código siguiente, buscando en internet: https://www.codesd.com/item/python-requests-exceptions-sslerror-key-dh-too-small.html
|
Podrías indicarme la versión de tu HASS y sobre qué sistema operativo está instalado. Realizaré un cambio con el código propuesto pero debo asegurar que no rompe otros entornos. |
Hassbian 0.98.1 System Health |
I have the same problem. My Home Assistant is 0.101.3 Making the request by browsing to the API I get a 200 If I run curl I get error:
If I run wget it works. |
… PR. - Fixed api key too short error: Caused by SSLError(SSLError(1, '[SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1123)')) Thanks to @dave-code-ruiz as he pointed the solution in this comment: outon/HomeAssistant-AEMET#1 (comment) - Thanks to @fermartv for preparing the PR
sep 03 09:29:03 hassbian hass[1221]: 2019-09-03 09:29:03 ERROR (SyncWorker_9) [custom_components.aemet.aemet] Unable to retrieve data from AEMET. HTTPSConnectionPool(host='opendata.aemet.es', port=443): Max retries exceeded with url: /opendata/api/observacion/convencional/todas?api_key=eyJhXXX7meUo (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_ske_dhe', 'dh key too small')])")))
sep 03 09:29:05 hassbian hass[1221]: 2019-09-03 09:29:05 ERROR (MainThread) [homeassistant.components.weather] aemet: Error on device update!
my configuration.yaml:
Don't work for me, i renew my api_key but same error
The text was updated successfully, but these errors were encountered: