Closed ghost closed 6 months ago
Is implemented in 2.0.9
It is still showing sunny at night with 2.0.9.
Was able to see a bit more. Later than midnight the clear-night symbol is shown. But everything up to midnight still shows sunny. The time period for clear-night might need some further adjustments.
The right way to time it would be via the sunset/sunrise times for the selected station. If DWD doesn't provide that, perhaps it is best to pull it from a different API. Otherwise you could also use a monthly table for Germany in general to approximate the times.
Or at least a more plausible fixed time period. For example 8pm to 7am or something like that.
Thanks for the suggested solutions. As the weather data is provided for stations all over the world (I guess it's mainly used in Germany, but there are some stations used outside Germany), I have to find a solution which fits all.
The "sun.sun" entity is available in home assistant out of the box. If "below horizon", show clear-night. If sun.sun is above horizon (or unavailable/unknown) show sunny.
Workaround idea: Using Trigger based handling of service response data it should be relatively easy to create a custom weather entity based on the dwd weather and use a template to change sunny to clear-night with sun below horizon.
Like this: (to do: add forecast_daily_template. This is challenging since the forcast is no longer an attribute to get the data from.
weather
The "sun.sun" entity is available in home assistant out of the box. If "below horizon", show clear-night. If sun.sun is above horizon (or unavailable/unknown) show sunny.
But this will only work, if you select a station which is near your home.
I'll found a library which does this. I'll include this in the next release.
with 2.0.11 I get 'sunny' instead of 'clear-night' for 4 o'clock in the morning when it's definitely still pitch-black dark over here (earlier it's cloudy here, so can't really say for evening behaviour). see screenshot.
Same here. At 3am it is sunny.
Found the error. The arguments of lat and lon for the library were in an unexpected order, which led to false sunrise/sunset times. Should be fixed in 2.0.12
Just wanted to say thanks again for this fix. Every time I see the clear-night icon now, I enjoy this!
Is your feature request related to a problem? Please describe. A clear sky condition at night is shown as "sunny" (at least in the hourly forcast).
Describe the solution you'd like Showing the icon "clear-night" during night hours, like this weather integration: