Skip to content
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

OpenWeatherMap integration fails to start #74527

Closed
omriasta opened this issue Jul 6, 2022 · 13 comments · Fixed by #74578
Closed

OpenWeatherMap integration fails to start #74527

omriasta opened this issue Jul 6, 2022 · 13 comments · Fixed by #74578

Comments

@omriasta
Copy link
Contributor

omriasta commented Jul 6, 2022

The problem

OpenWeatherMap does not load after upgrade to 2022.7 with the following error:

Logger: homeassistant.components.weather
Source: components/openweathermap/weather.py:146
Integration: Weather (documentation, issues)
First occurred: 3:56:01 PM (2 occurrences)
Last logged: 3:56:01 PM

Error adding entities for domain weather with platform openweathermap
Error while setting up openweathermap platform for weather
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 698, in state_attributes
    if self.forecast is not None:
  File "/usr/src/homeassistant/homeassistant/components/openweathermap/weather.py", line 145, in forecast
    forecasts = [
  File "/usr/src/homeassistant/homeassistant/components/openweathermap/weather.py", line 146, in <listcomp>
    {ha_key: forecast[api_key] for api_key, ha_key in FORECAST_MAP.items()}
  File "/usr/src/homeassistant/homeassistant/components/openweathermap/weather.py", line 146, in <dictcomp>
    {ha_key: forecast[api_key] for api_key, ha_key in FORECAST_MAP.items()}
KeyError: 'templow'

What version of Home Assistant Core has the issue?

core-2022.7

What was the last working version of Home Assistant Core?

core-2022.6.7

What type of installation are you running?

Home Assistant OS

Integration causing the issue

OpenWeaatherMap

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.weather
Source: components/openweathermap/weather.py:146
Integration: Weather (documentation, issues)
First occurred: 3:56:01 PM (2 occurrences)
Last logged: 3:56:01 PM

Error adding entities for domain weather with platform openweathermap
Error while setting up openweathermap platform for weather
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 698, in state_attributes
    if self.forecast is not None:
  File "/usr/src/homeassistant/homeassistant/components/openweathermap/weather.py", line 145, in forecast
    forecasts = [
  File "/usr/src/homeassistant/homeassistant/components/openweathermap/weather.py", line 146, in <listcomp>
    {ha_key: forecast[api_key] for api_key, ha_key in FORECAST_MAP.items()}
  File "/usr/src/homeassistant/homeassistant/components/openweathermap/weather.py", line 146, in <dictcomp>
    {ha_key: forecast[api_key] for api_key, ha_key in FORECAST_MAP.items()}
KeyError: 'templow'

Additional information

No response

@probot-home-assistant
Copy link

openweathermap documentation
openweathermap source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @fabaff, @freekode, @nzapponi, mind taking a look at this issue as it has been labeled with an integration (openweathermap) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@omriasta
Copy link
Contributor Author

omriasta commented Jul 6, 2022

Just a quick update, I deleted the integration and set it up again and no issue now.....

@jreed509
Copy link

jreed509 commented Jul 6, 2022

I tried deleting and re-adding the integration but that didn't fix it for me. It looks like the integrations starts properly when using the onecall_daily option but not with onecall_hourly.

@N1c093
Copy link
Contributor

N1c093 commented Jul 6, 2022

I tried deleting and re-adding the integration but that didn't fix it for me. It looks like the integrations starts properly when using the onecall_daily option but not with onecall_hourly.

This is exactly the same what I noticed. I'm using both onecall_daily & onecall_hourly.
onecall_daily is working
onecall_hourly isn't working

@dev-tty
Copy link

dev-tty commented Jul 6, 2022

I'm having this exact same issue too with the same errors.

@ziptbm
Copy link

ziptbm commented Jul 6, 2022

Looks like I got the same thing after upgrading to core-2022.7. I then tried to delete the integration and then re-add it, but the weather.openweathermap sensor continues to not work for me. However, the other sensors appear to be gathering data fine.

`Logger: homeassistant.components.weather
Source: components/openweathermap/weather.py:146
Integration: Weather (documentation, issues)
First occurred: 16:53:52 (4 occurrences)
Last logged: 17:08:47

Error adding entities for domain weather with platform openweathermap
Error while setting up openweathermap platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/weather/init.py", line 698, in state_attributes
if self.forecast is not None:
File "/usr/src/homeassistant/homeassistant/components/openweathermap/weather.py", line 145, in forecast
forecasts = [
File "/usr/src/homeassistant/homeassistant/components/openweathermap/weather.py", line 146, in
{ha_key: forecast[api_key] for api_key, ha_key in FORECAST_MAP.items()}
File "/usr/src/homeassistant/homeassistant/components/openweathermap/weather.py", line 146, in
{ha_key: forecast[api_key] for api_key, ha_key in FORECAST_MAP.items()}
KeyError: 'templow'
`

@rmatte
Copy link

rmatte commented Jul 6, 2022

Can confirm that I'm seeing the same issue after updating home assistant core to 2022.7.0 using the onecall_hourly option with the OpenWeatherMap integration. Removing and re-adding the integration doesn't fix it if I select onecall_hourly again (which is the mode that I want it to run in).

@ryingg
Copy link

ryingg commented Jul 6, 2022

Same issue where onecall_hourly is broken even after readding integration, but onecall_daily works

@kdknigga
Copy link

kdknigga commented Jul 7, 2022

I've manually applied the fix in #74578 and can confirm that it's working for me.

@nawwman
Copy link

nawwman commented Jul 7, 2022

I've got the same issue after updating HA to 2022.7, I also had onecall_hourly set for my openweathermap

@merc4derp
Copy link

I know it doesn't help, but the more people talking about it, the more likely it gets fixed I suppose. Getting the same thing here.

@kdknigga
Copy link

kdknigga commented Jul 7, 2022

the more people talking about it, the more likely it gets fixed

The fix is already done. It's just waiting for a release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.