pkissling / clock-weather-card

A Home Assistant Card indicating today's date/time, along with an iOS inspired weather forecast for the next days with animated icons
Other
309 stars 66 forks source link

Recurrence of issue from #287 #294

Closed phurth closed 7 months ago

phurth commented 7 months ago

I am seeing the same issue as closed bug #287 except this happens in the following situation:

In a separate Home Assistant install I am still getting the same error and the forecast is not rendering after updating to 2.1.8. In this case, the weather entity is set via the HA API, but is otherwise the same NWS weather object. This also worked just fine on 2.1.3. Below I'm including the attributes first from weather.kimt_daynight, then from weather.custom_location which is set to the value of the first via the API. They should be identical, but when using weather.custom_location in the clock weather card no longer displays the forecast days.

temperature: 35
temperature_unit: °F
humidity: 54
pressure: 30.07
pressure_unit: inHg
wind_bearing: 110
wind_speed: 3.36
wind_speed_unit: mph
visibility: 10
visibility_unit: mi
precipitation_unit: in
forecast: 
- detailed_description: >-
    Partly sunny. High near 35, with temperatures falling to around 30 in the
    afternoon. East southeast wind around 3 mph.
  datetime: '2023-12-02T14:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: cloudy
  wind_bearing: 112.5
  temperature: 35
  dew_point: 24
  wind_speed: 3
  humidity: 78
- detailed_description: Mostly cloudy, with a low around 25. East northeast wind around 5 mph.
  datetime: '2023-12-02T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: cloudy
  wind_bearing: 67.5
  temperature: 25
  dew_point: 27
  wind_speed: 5
  humidity: 100
- detailed_description: >-
    A chance of snow before 5pm. Cloudy. High near 32, with temperatures falling
    to around 30 in the afternoon. North northeast wind 5 to 8 mph. Chance of
    precipitation is 50%. New snow accumulation of less than one inch possible.
  datetime: '2023-12-03T06:00:00-06:00'
  precipitation_probability: 50
  is_daytime: true
  condition: snowy
  wind_bearing: 22.5
  temperature: 32
  dew_point: 28
  wind_speed: 6.5
  humidity: 96
- detailed_description: Mostly cloudy, with a low around 22. North northwest wind around 5 mph.
  datetime: '2023-12-03T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: cloudy
  wind_bearing: 337.5
  temperature: 22
  dew_point: 26
  wind_speed: 5
  humidity: 100
- detailed_description: Mostly sunny, with a high near 37. West wind around 6 mph.
  datetime: '2023-12-04T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: partlycloudy
  wind_bearing: 270
  temperature: 37
  dew_point: 24
  wind_speed: 6
  humidity: 98
- detailed_description: >-
    A chance of snow showers. Mostly cloudy, with a low around 23. Chance of
    precipitation is 30%.
  datetime: '2023-12-04T18:00:00-06:00'
  precipitation_probability: 30
  is_daytime: false
  condition: snowy
  wind_bearing: 135
  temperature: 23
  dew_point: 25
  wind_speed: 6
  humidity: 100
- detailed_description: Mostly cloudy, with a high near 37.
  datetime: '2023-12-05T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: cloudy
  wind_bearing: 0
  temperature: 37
  dew_point: 28
  wind_speed: 8
  humidity: 98
- detailed_description: Mostly cloudy, with a low around 23.
  datetime: '2023-12-05T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: cloudy
  wind_bearing: 315
  temperature: 23
  dew_point: 26
  wind_speed: 9
  humidity: 94
- detailed_description: >-
    A slight chance of snow showers after noon. Mostly cloudy, with a high near
    36.
  datetime: '2023-12-06T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: snowy
  wind_bearing: 247.5
  temperature: 36
  dew_point: 25
  wind_speed: 10
  humidity: 93
- detailed_description: >-
    A slight chance of snow showers before midnight. Mostly cloudy, with a low
    around 26.
  datetime: '2023-12-06T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: snowy
  wind_bearing: 202.5
  temperature: 26
  dew_point: 28
  wind_speed: 12
  humidity: 97
- detailed_description: Partly sunny, with a high near 41.
  datetime: '2023-12-07T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: cloudy
  wind_bearing: 180
  temperature: 41
  dew_point: 32
  wind_speed: 9
  humidity: 96
- detailed_description: Mostly cloudy, with a low around 28.
  datetime: '2023-12-07T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: cloudy
  wind_bearing: 225
  temperature: 28
  dew_point: 31
  wind_speed: 10
  humidity: 100
- detailed_description: Mostly cloudy, with a high near 41.
  datetime: '2023-12-08T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: cloudy
  wind_bearing: 270
  temperature: 41
  dew_point: 36
  wind_speed: 12
  humidity: 100
- detailed_description: A slight chance of rain showers. Mostly cloudy, with a low around 28.
  datetime: '2023-12-08T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: rainy
  wind_bearing: 315
  temperature: 28
  dew_point: 33
  wind_speed: 13
  humidity: 100
attribution: Data from National Weather Service/NOAA
friendly_name: KIMT Daynight
supported_features: 6
temperature: 35
temperature_unit: °F
humidity: 54
pressure: 30.07
pressure_unit: inHg
wind_bearing: 110
wind_speed: 3.36
wind_speed_unit: mph
visibility: 10
visibility_unit: mi
precipitation_unit: in
forecast: 
- detailed_description: >-
    Partly sunny. High near 35, with temperatures falling to around 30 in the
    afternoon. East southeast wind around 3 mph.
  datetime: '2023-12-02T14:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: cloudy
  wind_bearing: 112.5
  temperature: 35
  dew_point: 24
  wind_speed: 3
  humidity: 78
- detailed_description: Mostly cloudy, with a low around 25. East northeast wind around 5 mph.
  datetime: '2023-12-02T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: cloudy
  wind_bearing: 67.5
  temperature: 25
  dew_point: 27
  wind_speed: 5
  humidity: 100
- detailed_description: >-
    A chance of snow before 5pm. Cloudy. High near 32, with temperatures falling
    to around 30 in the afternoon. North northeast wind 5 to 8 mph. Chance of
    precipitation is 50%. New snow accumulation of less than one inch possible.
  datetime: '2023-12-03T06:00:00-06:00'
  precipitation_probability: 50
  is_daytime: true
  condition: snowy
  wind_bearing: 22.5
  temperature: 32
  dew_point: 28
  wind_speed: 6.5
  humidity: 96
- detailed_description: Mostly cloudy, with a low around 22. North northwest wind around 5 mph.
  datetime: '2023-12-03T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: cloudy
  wind_bearing: 337.5
  temperature: 22
  dew_point: 26
  wind_speed: 5
  humidity: 100
- detailed_description: Mostly sunny, with a high near 37. West wind around 6 mph.
  datetime: '2023-12-04T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: partlycloudy
  wind_bearing: 270
  temperature: 37
  dew_point: 24
  wind_speed: 6
  humidity: 98
- detailed_description: >-
    A chance of snow showers. Mostly cloudy, with a low around 23. Chance of
    precipitation is 30%.
  datetime: '2023-12-04T18:00:00-06:00'
  precipitation_probability: 30
  is_daytime: false
  condition: snowy
  wind_bearing: 135
  temperature: 23
  dew_point: 25
  wind_speed: 6
  humidity: 100
- detailed_description: Mostly cloudy, with a high near 37.
  datetime: '2023-12-05T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: cloudy
  wind_bearing: 0
  temperature: 37
  dew_point: 28
  wind_speed: 8
  humidity: 98
- detailed_description: Mostly cloudy, with a low around 23.
  datetime: '2023-12-05T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: cloudy
  wind_bearing: 315
  temperature: 23
  dew_point: 26
  wind_speed: 9
  humidity: 94
- detailed_description: >-
    A slight chance of snow showers after noon. Mostly cloudy, with a high near
    36.
  datetime: '2023-12-06T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: snowy
  wind_bearing: 247.5
  temperature: 36
  dew_point: 25
  wind_speed: 10
  humidity: 93
- detailed_description: >-
    A slight chance of snow showers before midnight. Mostly cloudy, with a low
    around 26.
  datetime: '2023-12-06T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: snowy
  wind_bearing: 202.5
  temperature: 26
  dew_point: 28
  wind_speed: 12
  humidity: 97
- detailed_description: Partly sunny, with a high near 41.
  datetime: '2023-12-07T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: cloudy
  wind_bearing: 180
  temperature: 41
  dew_point: 32
  wind_speed: 9
  humidity: 96
- detailed_description: Mostly cloudy, with a low around 28.
  datetime: '2023-12-07T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: cloudy
  wind_bearing: 225
  temperature: 28
  dew_point: 31
  wind_speed: 10
  humidity: 100
- detailed_description: Mostly cloudy, with a high near 41.
  datetime: '2023-12-08T06:00:00-06:00'
  precipitation_probability: 0
  is_daytime: true
  condition: cloudy
  wind_bearing: 270
  temperature: 41
  dew_point: 36
  wind_speed: 12
  humidity: 100
- detailed_description: A slight chance of rain showers. Mostly cloudy, with a low around 28.
  datetime: '2023-12-08T18:00:00-06:00'
  precipitation_probability: 0
  is_daytime: false
  condition: rainy
  wind_bearing: 315
  temperature: 28
  dew_point: 33
  wind_speed: 13
  humidity: 100

attribution: Data from National Weather Service/NOAA
friendly_name: KIMT Daynight
supported_features: 6
pkissling commented 7 months ago

hi @phurth, can you please elaborate on your following statement:

in this case, the weather entity is set via the HA API

what do you mean by that? can you clarify?

phurth commented 7 months ago

Yes, sorry. I have a NodeRed flow set up that allows me to switch between predefined locations (and the related weather forecast). To do this, I have a weather entity set up in configuration.yaml which gets set via the HA API in NodeRed. The flow simply sets the custom location attributes from the JSON payload of the appropriate NWS entity attributes.

Using this weather entity allows me to set the front end up such that it updates automatically if the location is changed by the flow.

With the above, in version 2.1.3 of the card, the forecast displayed as expected. In subsequent versions, it does not.

Thanks in advance, and let me know if you need for specific details.

pkissling commented 7 months ago

okay i see, thanks for the explanation. the weather entity you are emulating exposes supported_features: 6. this indicates, that the weather entity does support the new weather.get_forecast service (https://www.home-assistant.io/integrations/weather/#service-weatherget_forecast). consequently clock-weather-card tries to subscribe to weather updates (which will fail - hence the forecast is not rendered properly).

please try to either

  1. override supported_features:6 with supported_features: 0
  2. omit the attribute entirely

this way, clock-weather-card will read the forecasts from the forecast attribute and will not try to subscribe to the weather service

phurth commented 7 months ago

I modified my NodeRed flow to delete the supported_features attribute and now it is working as expected. Thanks!