Support for Combined Weather Conditions and Day/Night Representation in Weather Integration

Hi all!

Description:

The current Home Assistant Weather Integration supports only a single weather state for both current weather and forecast data, limiting the representation of more complex weather conditions. Many weather data providers, such as ARSO (Agencija RS za okolje), offer weather descriptions that combine sky conditions (e.g., cloudy, partly cloudy, sunny) with specific weather phenomena (e.g., rain, snow, fog, thunderstorms). For instance, ARSO may report conditions like “cloudy + light rain,” “partly cloudy + fog,” or “overcast + snow.”

Additionally, the current integration only distinguishes between day and night for the “clear-night” condition. For other conditions, such as “partly cloudy” or “cloudy,” the same icon is used regardless of whether it is day or night. For example, “partly cloudy” always shows a sun behind clouds, even during nighttime, which can lead to inaccurate representations of the current weather state.

Proposed Solution:

  1. Support for Combined Weather Conditions:
  • Enhance the Home Assistant Weather Integration to support combined weather conditions that reflect both sky cover according to okta (meteorological measurement unit of clouds amount. - e.g., cloudy, partly cloudy, clear,…) and weather phenomena (e.g., rain, fog, snow, drizzle, hail, mist,…) simultaneously.
  • Display combined weather conditions on the frontend, showing users both sky cover and the corresponding weather event.
  • Ensure this feature is compatible with both current weather data and forecast information.
  1. Day/Night Representation for All Weather Conditions:
  • Introduce day/night variations for all weather conditions, not just “clear-night.”
  • For example, “partly cloudy” could display a moon behind clouds during the night, and “cloudy” or “rainy” could have night-specific icons to better reflect the actual time of day.
  • Ensure icons and data are consistent with the actual day/night cycle, making the weather representation more accurate and useful to users.

Example Use Cases:

  • Display “cloudy + light rain” during both the day and night, with appropriate icons for each time period.
  • Show “partly cloudy + fog” with a moon during the night and a sun during the day.
  • Reflect winter conditions with “overcast + snow,” using distinct icons for daytime and nighttime.

Benefit:

  • Combined Weather Conditions: Providing a more detailed and accurate representation of weather conditions, allowing users to see both sky conditions and significant weather events simultaneously. This would better align with data provided by weather services and improve the accuracy of weather-related automations.
  • Day/Night Representation: Offering day/night-specific icons for all weather conditions improves the visual representation of weather and enhances the overall user experience, especially for nighttime weather monitoring.

Conclusion: Most Weather Services (national) provide numerous data and it would be not bad if we could use them to provide more accurate weather data. Enhancing the Home Assistant Weather Integration with support for combined weather conditions and day/night representation for all weather states would significantly improve both the accuracy and the visual representation of weather information. This would benefit users by providing a more comprehensive and realistic view of the current weather and forecasts, making it easier to plan and automate actions based on accurate weather data.

Thank you for considering these feature requests!

I agree that the better we can represent the weather, then we ask benefit.

Currently, as you will know, the state of a weather entity is one of the strings represented here

https://www.home-assistant.io/integrations/weather/#condition-mapping

As you will also know, entities can only have one state. You are, I think, looking for combing two concepts into a state. Never gonna happen!

Your suggestion might be better if you propose some aspects as attributes. Eg, state: partly_cloudy, attribute other_conditions: [fog, light_rain]

As far as representation in the UI is concerned, that is a matter for the card you are using. It is nothing to do with the weather integration as such. But it is easy to imagine a card that combines the state and attributes and time of day to create dynamic icons.

Thank you @nickrout ! I came accross this idea while building custom component - weather integration while only one weather condition state (or forecast) is available as a kind of vague or sometimes inaccurate. From meteorological perspective listed states - cloud coverage are mixed with weather phenomena. Which in the first place is not accurate because the weather can be foggy with clear skies (0/8 or 1/8 clouds coverage) (HA presents this as fog or as sunny - if it’s sunny is not true, if it’s fog it lacks cloud coverage information. Another example: partly cloudy with moderate snow (as per weather service) - HA could report only as partly cloudly or snowy - which is again nor accurate nor true. And I have a lot of other examples when building and testing my integration some of Slovenia locations had snow storm and weather services reported plenty of combinations (cloud coverage + phenomena) which I had to reduce to numerus clausus states. I’m pasting mappings from my code below:

CLOUD_CONDITION_MAP = {
    # Common weather conditions from 'wwsyn_shortText' and 'clouds_shortText'
    "jasno": "sunny",
    "delno oblačno": "partlycloudy",
    "pretežno oblačno": "cloudy",
    "oblačno": "cloudy",
    "megla": "fog",
    "dežuje": "rainy",
    "možnost neviht": "lightning-rainy",
    "dež": "rainy",
    "plohe": "pouring",
    "sneži": "snowy",
    "toča": "hail",
    "sneg z dežjem": "snowy-rainy",
    "vetrovno": "windy",
    "veter z oblaki": "windy-variant",

    # Overcast conditions with thunderstorms and rain ('clouds_icon_wwsyn_icon')
    "overcast_heavytsra_day": "lightning-rainy",
    "overcast_heavytsra_night": "lightning-rainy",
    "overcast_heavyra_day": "rainy",  # Corrected to lowercase
    "overcast_heavyra_night": "rainy",
    "overcast_modtsra_day": "lightning-rainy",
    "overcast_modtsra_night": "lightning-rainy",
    "overcast_modra_day": "rainy",  # Corrected to lowercase
    "overcast_modra_night": "rainy",
    "overcast_lightra_day": "rainy",
    "overcast_lightra_night": "rainy",
    "overcast_lighttsra_day": "lightning-rainy",
    "overcast_lighttsra_night": "lightning-rainy",
    "overcast_day": "cloudy",
    "overcast_night": "cloudy",
    "overcast_lightfg_night": "cloudy",
    "overcast_lightfg_day": "cloudy",
    "overcast_lightra_night": "rainy",
    "overcast_lightra_day": "rainy",
    "overcast_modrasn_night": "snowy-rainy",
    "overcast_modrasn_day": "snowy-rainy",
    "overcast_lightrasn_day": "snowy-rainy",
    "overcast_lightrasn_night": "snowy-rainy",
    "overcast_heavyrasn_night": "snowy-rainy",
    "overcast_heavyrasn_day": "snowy-rainy",
    "overcast_modsn_day": "snowy",
    "overcast_modsn_night": "snowy",
    "overcast_lightsn_day": "snowy",
    "overcast_lightsn_night": "snowy",
    "overcast_modra_night": "rainy",
    "overcast_modra_day": "rainy",
    

    # Partly cloudy and rainy conditions ('clouds_icon_wwsyn_icon')
    "partcloudy_night": "partlycloudy",
    "partcloudy_day": "partlycloudy",
    "partcloudy_lightra_day": "pouring",
    "partcloudy_lightra_night": "pouring",
    "partcloudy_heavytsra_day": "lightning-rainy",
    "partcloudy_heavytsra_night": "lightning-rainy",
    "partcloudy_modsn_night": "snowy",
    "partcloudy_modsn_day": "snowy",
    "partcloudy_lightsn_night": "snowy",
    "partcloudy_lightsn_day": "snowy",
    "partcloudy_heavysn_night": "snowy",
    "partcloudy_heavysn_day": "snowy",
    "partcloudy_lightfg_day": "fog",
    "partcloudy_lightfg_night": "fog",

    # Storm conditions ('clouds_icon_wwsyn_icon')
    "prevcloudy_modts_day": "lightning", 
    "prevcloudy_modts_night": "lightning",
    "prevcloudy_heavyts_day": "lightning",
    "prevcloudy_heavyts_night": "lightning",
    "prevcloudy_lightra_night": "rainy",
    "prevcloudy_lightra_day": "rainy",
    "prevcloudy_modra_day": "rainy",
    "prevcloudy_modra_night": "rainy",
    "prevcloudy_heavyra_day": "rainy",
    "prevcloudy_heavyra_night": "rainy",
    "prevcloudy_modsn_day": "snowy",
    "prevcloudy_modsn_night": "snowy",
    "prevcloudy_lightsn_day": "snowy",
    "prevcloudy_lightsn_night": "snowy",
    "prevcloudy_heavysn_day": "snowy",
    "prevcloudy_heavysn_night": "snowy",
    "prevcloudy_lightfg_night": "cloudy",
    "prevcloudy_lightfg_day": "cloudy",
    "prevcloudy_modfg_night": "fog",
    "prevcloudy_modfg_day": "fog",
    "prevcloudy_heavyfg_night": "fog",
    "prevcloudy_heavyfg_day": "fog",
    "prevcloudy_lightrasn_day": "snowy-rainy",
    "prevcloudy_lightrasn_night": "snowy-rainy",

    # Clear conditions
    "clear_night": "clear-night",
    "clear_day": "sunny",
    "clear_lightfg_night": "fog",
    "clear_lightfg_day": "fog",

    # Additional conditions ('clouds_icon_wwsyn_icon', 'wwsyn_shortText', etc.)
    "mostly_clear_night": "clear-night",
    "mostly_clear_day": "sunny",
    "foggy": "fog",
    "drizzle": "rainy",
    "light_snow": "snowy",
    "heavy_snow": "snowy",
    "partly_cloudy_rain": "rainy",
    "partly_cloudy_day": "partlycloudy",
    "partly_cloudy_night": "partlycloudy",
    "thunderstorm": "lightning-rainy",
    "hailstorm": "hail",
    "blizzard": "snowy",
    "prevcloudy_day": "cloudy",
    "prevcloudy_night": "cloudy",
}

I hope that from this examples the distinction between cloud coverage and weather phenomena is a bit clearer. It’s not my purpose to mess things with entity states up, maybe the short list of entitiy states could be longer or more exhaustive…

Anyway, thank you again for considering my proposal and interacted with it! Appreciate it!