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
72.71k stars 30.45k forks source link

AEMET integration always fails after HA restart #112069

Closed lufetico closed 7 months ago

lufetico commented 7 months ago

The problem

After reset HA the Aemet integration always fails and it's necessary reload it for it start to work.

What version of Home Assistant Core has the issue?

2024.2.3

What was the last working version of Home Assistant Core?

2024.1.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

aemet

Link to integration documentation on our website

https://www.home-assistant.io/integrations/aemet/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: config_entries.py:444
First occurred: 22:24:19 (1 occurrences)
Last logged: 22:24:19

Error setting up entry AEMET for aemet
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, 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.12/site-packages/aemet_opendata/interface.py", line 399, in select_coordinates
    await self.get_conventional_observation_station_by_coordinates(
  File "/usr/local/lib/python3.12/site-packages/aemet_opendata/interface.py", line 305, in get_conventional_observation_station_by_coordinates
    stations = await self.get_conventional_observation_stations()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aemet_opendata/interface.py", line 298, in get_conventional_observation_stations
    return await self.api_call("observacion/convencional/todas", fetch_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aemet_opendata/interface.py", line 135, in api_call
    resp: ClientResponse = await self.aiohttp_session.request(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 504, in _request
    with timer:
  File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in __exit__
    raise asyncio.TimeoutError from None
TimeoutError

Additional information

No response

home-assistant[bot] commented 7 months ago

Hey there @noltari, mind taking a look at this issue as it has been labeled with an integration (aemet) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `aemet` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign aemet` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


aemet documentation aemet source (message by IssueLinks)

user514 commented 7 months ago

Exactly same behaviour here. After some update on february, it goes o red on devices & services and need to reload integration to load right.

Looks like it needs some kind of delay to be able to start.on restart.

lufetico commented 7 months ago

Yesterday I updated to HA 2024.2.5 and the problem seems to have disappeared. I have had to restart HA at least 3 times and so far the AEMET integration has not failed.

Noltari commented 7 months ago

Duplicate of https://github.com/home-assistant/core/issues/107755 Fixed by https://github.com/home-assistant/core/pull/111092

Noltari commented 7 months ago

@home-assistant close