WTH - It's sunny at midnight when using Open-Meteo

I was just checking out some history at around midnight and it seem that it was Sunny at home… .

Clear sky might be more appropriate?

That comes from your weather integration. They are all different in that regard and it depends on what the API provides.

Ok, I am using Open-Meteo - Home Assistant which is a built-in integration.

Looking at the code there is a mapping from the open_meteo code to the HA code.

The comments indicate that “Clear sky” and “Mainly clear” are mapped to “Sunny”, independant of the time (sun risen or sun down).
“Clear sky” and “Mainly clear” are sun-independant expressions.

There is a “clear-night” constant .

I’ld think its how the API is interpreted and mapped to the internals here.

I don’t see a clear-night there. This is what I mean by “what the API provides”.

Dark sky does exactly what you want, because it provides clear-night from the api.

Open-meteo provides “Clear sky” which can be translated to clear-night or sunny depending on whether the sun is up or not.

HA’s builtin integration is translating “Clear sky” in Sunny.

The way I read your commant is that it implied that the API was probably indicating “sunny”, in which case it would be more logical for the integration to also indicate sunny (which could still be corrected between sunset and sunrise).

Anyway, something minor, which I supposed WTH was all about.

Sure it can be, but that’s an issue with that specific weather platform, not all platforms. Secondly, it would have to be added for that specific platform and it would most likely rely on another library because you can’t just get sunrise information out of thin air. Nor can you assume that sun is loaded in HA. Either way, I’ll edit your title to reflect the problem.