decompil3d / lovelace-hourly-weather

Hourly weather card for Home Assistant. Visualize upcoming weather conditions as a colored horizontal bar.
MIT License
304 stars 32 forks source link

Add 'partly cloudy night' #662

Open JanDetrez opened 7 months ago

JanDetrez commented 7 months ago

Is it possible to have a 'partly cloudy night' condition so we see an icon of a moon with clouds during the night, instead of the sun?

Of course, this requires the weather integration to provide this condition as well. I asked if the particular one I am using, can do this. https://github.com/jdejaegh/irm-kmi-ha/issues/16

To have a generalised solution, you could also consider to have the Lovelace integration check sunrise/sundown and edit the icon accordingly even if the weather integration does not discriminate between night and day. Not sure how/if it is technically possible to do this sort of override.

As you see below, it is a bit odd that during the night we see this 'partly cloudy' condition with a sun.

Screenshot_20240331-064528

JanDetrez commented 7 months ago

FYI in the post linked above @jdejeagh mentioned ways of solving this in the lovelace card :-) thanks for considering implementing this.

decompil3d commented 5 months ago

Reopening this since the original fix was buggy.

formatBCE commented 5 months ago

@decompil3d could that buggy fix (with sunrise/sunset usage) be the reason of https://github.com/decompil3d/lovelace-hourly-weather/issues/696 ? I was checking the changes between 5.4.0 and 6.0.0, and that function is the only suspicious thing (well, apart from bunch of lib updates, that could cause it of course), and since the time is also shown incorrectly for me, i thought maybe it's something with UTC/non-UTC stuff, or location settings?

P.S. actually, i see that you removed that code in 6.0.1 when disabled new changes. Let me install 6.0.1 and see if it works.

P.P.S. nope, it's some updated libs that causing it, unfortunately...

fcastilloec commented 3 weeks ago

I've been using Tomorrow.io as my weather provider, and they do have different icons for day and night, but I haven't been happy with their forecast. I want to switch to OpenWeather because they're more accurate, but they don't have day/night distinct icons. Is this the right issue to track progress on implementing back this feature? or should I follow 692? Have you thought of using suncalc-ts? I've used it in the past without issues, but I haven't tested it on a lot of locations.

Also, could you use sensor.sun_next_rising and sensor.sun_next_setting and limit the offset and number of segments shown? In other words, as long as the last segment shown is not more than 24h into the future from now, the sun sensors will work without issues and always show the next immediate day or night without relying on external libraries. Of course, this will limit functionality for some people, but this can be added as a configuration option. If people want more than 24 hours, they can disable the night icons/colors option and just show whatever the weather integration supports.