kalkih / simple-weather-card

Minimalistic weather card for Home Assistant
MIT License
285 stars 33 forks source link

Account for "overcast" conditions #2

Closed kjake closed 5 years ago

kjake commented 5 years ago

The image to load is 'undefined' when the current conditions are 'overcast' - which I think should just be 'cloudy' and could use the cloud icon.

kalkih commented 5 years ago

Great catch, which weather platform are you using? Strange that the docs do not mention that state: condition mapping.

kjake commented 5 years ago

I'm new to HA, so I didn't know this! I'm using the weather forecast provided by my thermostat, Ecobee.

weather.main_floor's state attributes:

{
  "temperature": 23,
  "humidity": 67,
  "pressure": 1023,
  "wind_bearing": 327,
  "wind_speed": 8,
  "visibility": 16000,
  "attribution": "Ecobee weather provided by <redacted> at 2019-03-03 18:02:32",
  "forecast": [
    {
      "datetime": "2019-03-03T13:02:32",
      "condition": "Overcast",
      "temperature": 23,
      "templow": 11,
      "pressure": 1023,
      "wind_speed": 16000,
      "humidity": 67
    },
    {
      "datetime": "2019-03-04T00:00:00",
      "condition": "Light snow (< 1 in.) overnight.",
      "temperature": 13,
      "templow": 5,
      "pressure": 1020,
      "wind_speed": 8000,
      "humidity": 66
    },
    {
      "datetime": "2019-03-05T00:00:00",
      "condition": "Snow (1–2 in.) in the morning.",
      "temperature": 18,
      "templow": 11,
      "pressure": 1019,
      "wind_speed": 5000,
      "humidity": 68
    },
    {
      "datetime": "2019-03-06T00:00:00",
      "condition": "Mostly cloudy throughout the day.",
      "temperature": 22,
      "templow": 11,
      "pressure": 1024,
      "wind_speed": 10000,
      "humidity": 72
    },
    {
      "datetime": "2019-03-07T00:00:00",
      "condition": "Overcast throughout the day.",
      "temperature": 27,
      "templow": 15,
      "pressure": 1025,
      "wind_speed": 15000,
      "humidity": 72
    }
  ],
  "friendly_name": "Main Floor"
}
kalkih commented 5 years ago

The icon is rendered based on the entity's state, not its attributes, also those are some strange conditions 🤔 Does that weather entity work with the default weather card (weather-forecast)? are the weather icons shown?

kjake commented 5 years ago

Here's an Imgur Album with two screen grabs of how it's looking on my end:https://imgur.com/a/PqyFc24

kjake commented 5 years ago

Updated the addin and I see a cloud now 👍

kalkih commented 5 years ago

Here's an Imgur Album with two screen grabs of how it's looking on my end

Oh yes, the icons are indeed missing there as well.

Updated the addin and I see a cloud now 👍

Perfect! Closing this issue.