home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.04k stars 2.77k forks source link

Weather-forecast card shows precipitation for tomorrow below current temperature #6461

Closed mweinelt closed 4 years ago

mweinelt commented 4 years ago

Checklist

The problem

I'm currently writing a weather entity and I've run into a problem.

When

I can resolve this by including todays data in the forecast array, but then today is included in the forecast display, which makes it feel like a crude workaround.

Expected behavior

Show precipitation as seconday attribute only if data suggests it for the current day.

Steps to reproduce

This is cumbersome to reproduce, since it depends on the behaviour of the weather entity which is not well specced in that regard. I'm currently working on the bright sky integration, where I stumbled upon this.

Environment

State of relevant entities

My weather entity (including today = 2020-07-25) shows:

temperature: 24.4
humidity: 42
pressure: 1013.8
wind_bearing: 290
wind_speed: 12.2
visibility: 66.3
attribution: Deutscher Wetterdienst
forecast: 
- datetime: '2020-07-24T22:00:00+00:00'
  temperature: 27.6
  templow: 15.3
  precipitation: 0
  wind_speed: 241.8
  wind_bearing: -130
  condition: cloudy
- datetime: '2020-07-25T22:00:00+00:00'
  temperature: 25.4
  templow: 18.1
  precipitation: 4.9
  wind_speed: 391.2
  wind_bearing: -135
  condition: rainy
- datetime: '2020-07-26T22:00:00+00:00'
  temperature: 26.9
  templow: 14.6
  precipitation: 0
  wind_speed: 212.4
  wind_bearing: -151
  condition: partlycloudy
- datetime: '2020-07-27T22:00:00+00:00'
  temperature: 29.5
  templow: 17.3
  precipitation: 0
  wind_speed: 276
  wind_bearing: -138
  condition: partlycloudy
- datetime: '2020-07-28T22:00:00+00:00'
  temperature: 24.5
  templow: 18.8
  precipitation: 0
  wind_speed: 284.9
  wind_bearing: -110
  condition: cloudy
- datetime: '2020-07-29T22:00:00+00:00'
  temperature: 25.3
  templow: 15.1
  precipitation: 0
  wind_speed: 198.7
  wind_bearing: -25
  condition: partlycloudy
- datetime: '2020-07-30T22:00:00+00:00'
  temperature: 28
  templow: 15.1
  precipitation: 0
  wind_speed: 73.4
  wind_bearing: -27
  condition: partlycloudy
- datetime: '2020-07-31T22:00:00+00:00'
  temperature: 30.2
  templow: 16.8
  precipitation: 0
  wind_speed: 110.1
  wind_bearing: -46
  condition: partlycloudy
- datetime: '2020-08-01T22:00:00+00:00'
  temperature: 28.9
  templow: 19.1
  precipitation: 0
  wind_speed: 139
  wind_bearing: -108
  condition: partlycloudy
- datetime: '2020-08-02T22:00:00+00:00'
  temperature: 27
  templow: 18.4
  precipitation: 0
  wind_speed: 242.3
  wind_bearing: -131
  condition: partlycloudy

friendly_name: Bright Sky

Today is saturday, and the weather-forecast card looks like so:

image

If I remove the current day from the forecast it looks like this:

image

Note how it is not supposed to rain today (saturday) and the precipitation is still shown for what I would interpret as today.

Problem-relevant configuration

n/a

Javascript errors shown in your browser console/inspector

n/a

Additional information

bramkragten commented 4 years ago

The attributes only show the current condition, the min/max and precipitation are forecasts and not the current.

I would advise to add forecast data for the current day, the current values don't say much about the rest of the day.

mweinelt commented 4 years ago

Thanks for the advise.