-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
AEMET OpenData #107755
Comments
Hey there @Noltari, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) aemet documentation |
Maybe the AEMET OpenData API was down at that time. |
Yes, I just checked and it is the same, sometimes the data are available, and sometimes not. The problem is that I have some sensors related to the data, and when is not available, I lost the sensor´s information. |
I know, but this is the expected behaviour. |
I was on my way to report a similar issue, but I thought I'd post here because I think it's related. Please, let me know if you think I should open it separately. My logs:
It's been happening to me for a few releases: every time I restart HASS the integration fails to setup due to timeouts. If I wait for HASS to settle and then reload this integration, it successfully loads. FWIW, I can see many other timeout errors coming from other integrations (prob my Raspberry Pi is not able to handle all the startup requests and they just timeout). I wonder if this is a matter of retries: I have the feeling (I haven't checked the code) that, if the integration fails to setup, it stays as failed forever and never retries. I worked around this with an automation that runs 5 minutes after HASS started, checks if AEMET's state is unavailable and reloads the integration. TL;DR, is it worth adding a retry logic on timeouts to the integration's setup process? Thank you @Noltari for your integration 😇 |
Similar Issue since I updated Home Assistant to 2024.2. Every time I restarted HA ... the integration fails to load ... so I need to reload. Usually one reload is enough ... but sometimes it fails several times and then stays as failed. So it needs a new reload after a while. Another strange behaviour is ... every day at 19:00h seems to be an error recovering some data (prepitation probability, storm probability and snow probability) ... and these sensors become "unavailable" or "unknown". And they became unavailable until midnight even if I reload the integration. I though this could be a problem with the station that provides the data ... but the weird thing is they stay as "unavailable" or "unknown" forever unless I reload the integration after the midnight. Before the midnight ... the reload didn't recover these sensors. After midnight if I reload the integration these sensors are recovered and they started to show the correct data again. |
@figorr this is a different issue, so please create a new one instead of reporting it on an unrelated issue. |
Ok, thanks @Noltari. I will open the new issue this afternoon to see if I can see anything in the logs. |
@rdlvm no info at all provided, so please refrain from doing this in the future. |
In case anyone is interested in the workaround, this is my definition in yaml: alias: "[HASS] Ensure AEMET works"
description: ""
trigger:
- platform: homeassistant
event: start
condition: []
action:
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- alias: Ensure AEMET works
repeat:
sequence:
- service: homeassistant.reload_config_entry
target:
entity_id: weather.aemet
data: {}
continue_on_error: true
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
while:
- condition: and
conditions:
- condition: state
entity_id: weather.aemet
state: unavailable
- condition: template
value_template: "{{ repeat.index < 60 }}"
alias: Less than 60 iterations
enabled: true
mode: single |
I'm having the same issue as Original post.
If i reload the integration it connects and retrieves it, but not permanently; after some time it fails again. Below my system data. This issue happens even if I restart in Safe Mode Thanks. System Information
Home Assistant Cloud
Home Assistant Supervisor
Dashboards
Recorder
|
The problem
Since I updated to the 2024.1 version of HA, the AEMET integration give me an error, It cannot be configured.
And I lost all weather details.
What version of Home Assistant Core has the issue?
2024.1.x
What was the last working version of Home Assistant Core?
2023.12.x
What type of installation are you running?
Home Assistant OS
Integration causing the issue
AEMET
Link to integration documentation on our website
No response
Diagnostics information
Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 22:27:37 (1 occurrences)
Last logged: 22:27:37
Error setting up entry AEMET for aemet
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/aemet/init.py", line 37, in async_setup_entry
await aemet.select_coordinates(latitude, longitude)
File "/usr/local/lib/python3.11/site-packages/aemet_opendata/interface.py", line 410, in select_coordinates
town_data = await self.get_town_by_coordinates(latitude, longitude)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aemet_opendata/interface.py", line 370, in get_town_by_coordinates
towns = await self.get_towns()
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aemet_opendata/interface.py", line 390, in get_towns
return await self.api_call("maestro/municipios")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aemet_opendata/interface.py", line 135, in api_call
resp: ClientResponse = await self.aiohttp_session.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 500, in _request
with timer:
File "/usr/local/lib/python3.11/site-packages/aiohttp/helpers.py", line 735, in exit
raise asyncio.TimeoutError from None
TimeoutError
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: