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
74.08k stars 31.09k forks source link

Clear nights reporting as sunny on weather forecast with Openweathermap #120841

Open gkwok1 opened 5 months ago

gkwok1 commented 5 months ago

The problem

Clear nights reporting as sunny on weather forecast with Openweathermap

image

What version of Home Assistant Core has the issue?

core-2024.6.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

OpenWeatherMap

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?

No response

Additional information

No response

home-assistant[bot] commented 5 months ago

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!

Code owner commands Code owners of `openweathermap` 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 openweathermap` 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)


openweathermap documentation openweathermap source (message by IssueLinks)

marcobologni commented 5 months ago

I have this problem!

f

ChristophCaina commented 5 months ago

not only clear nights, also partially cloudy is using the sun-icon

image

but that's independend of the used integration, since I am using DWD (Deutscher Wetterdienst)... I think, it is just the icon that's being used here.

smarthomefamilyverrips commented 5 months ago

I have this problem!

f

@marcobologni I would suggest to create a issue yourself as this is not the same issue as the OP has 🙂

rrowe629 commented 2 months ago

I have observed a similar (or perhaps the same) problem when using OpenWeatherMap to report conditions outside of my timezone as configured in HA. For example, my HA installation is configured for the Central time zone. If I retrieve OpenWeatherMap conditions for a location in the Eastern timezone and conditions are clear, I will see "sunny" until the sun sets in the Central timezone, even though it has already set at the observed location in the Eastern timezone. This is incorrect.

It's worth noting that the OpenWeatherMap API does not report "sunny" or "clear-night", it only reports a code. If the code is '800', then the integration determines whether to report "sunny" or "clear-night" based on the sun position in the HA timezone. I've noted that the OpenWeatherMap 3.0 API returns the sunrise and sunset times for the location specified by the lat/lon in the API call. I believe the correct behavior should be to examine this information to determine if the sun is up at the observed location and to report "sunny" or "clear-night" based on this rather than the sun position in the HA timezone.