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
73.49k stars 30.7k forks source link

OpenWeatherMap shows daily morning weather #36245

Closed metbril closed 4 years ago

metbril commented 4 years ago

The problem

When using the integration with the freedaily mode, the Weather card shows the morning weather at 8:00, instead of the day weather. For example, the temperatures are always much too low compared to other weather integrations.

Dark Sky

Schermafbeelding 2020-05-29 om 07 05 11

OpenWeatherMap

Schermafbeelding 2020-05-29 om 07 05 22

OpenWeatherMap (attributes)

Schermafbeelding 2020-05-29 om 07 06 40

Environment

Problem-relevant configuration.yaml

weather:
  - platform: openweathermap
    api_key: !secret openweathermap_api_key
    mode: freedaily

Traceback/Error logs

Additional information

The One Call API has daily forecasts for multiple times of the day: https://openweathermap.org/api/one-call-api

I think the integration currently uses the daily.temp.morn but should use daily.temp.day. I haven't been able to find this in the integration code, so it might as well be a bug in the OWM library.

https://github.com/home-assistant/core/blob/fbe7b4ddfa813e300f99175d254ec509c8d65e33/homeassistant/components/openweathermap/weather.py#L5

Schermafbeelding 2020-05-29 om 07 13 29
probot-home-assistant[bot] commented 4 years ago

Hey there @fabaff, mind taking a look at this issue as its been labeled with a integration (openweathermap) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

N1c093 commented 4 years ago

The one call api isn't implemented yet. They are working on it to integrate the one call api to the python wrapper pyowm https://github.com/csparpa/pyowm

After the python wrapper is updated they can go on and implement it into HA. There is already a feature request for it: https://community.home-assistant.io/t/convert-openweathermap-integration-to-use-one-call-api/186441

In the old API this behavour seems to be normal. It shows you the forecast for the next days, based on the current time.

edenhaus commented 4 years ago

The one call api isn't implemented yet. They are working on it to integrate the one call api to the python wrapper pyowm https://github.com/csparpa/pyowm

After the python wrapper is updated they can go on and implement it into HA. There is already a feature request for it: https://community.home-assistant.io/t/convert-openweathermap-integration-to-use-one-call-api/186441

In the old API this behavour seems to be normal. It shows you the forecast for the next days, based on the current time.

The OneCall Api is already implemented on the develop branch of pyown. The new version should be released soon.

eloo commented 4 years ago

The OneCall API is already released. https://github.com/csparpa/pyowm/releases/tag/3.0.0

Sadly this is not part of the latest HA release.

edenhaus commented 4 years ago

The OneCall API is already released. https://github.com/csparpa/pyowm/releases/tag/3.0.0

Sadly this is not part of the latest HA release.

There exists already plans to add it. I will add it after #34659 is merged.

eloo commented 4 years ago

@edenhaus sounds good :+1:

nzapponi commented 4 years ago

The OneCall API is already released. https://github.com/csparpa/pyowm/releases/tag/3.0.0 Sadly this is not part of the latest HA release.

There exists already plans to add it. I will add it after #34659 is merged.

It seems like #34659 is now merged! Any ETA on when we can expect it to be available in HA?

edenhaus commented 4 years ago

The OneCall API is already released. https://github.com/csparpa/pyowm/releases/tag/3.0.0 Sadly this is not part of the latest HA release.

There exists already plans to add it. I will add it after #34659 is merged.

It seems like #34659 is now merged! Any ETA on when we can expect it to be available in HA?

This month I have no time et all... Sorry I will look at it probably in October/November. If some one has time earlier please feel free to implement it.

nzapponi commented 4 years ago

FYI, done!