weather-chart-card
weather-chart-card copied to clipboard
From 2024.4.0, attributes.forecast will be removed
Starting this 3rd of April 2024, the new release of HA is no longer publishing the forecast as an attribute.
The code accessing attributes.forecast must be replaced by a call the get_forecasts service:
Probably something like this.
homeassistant.callService(weather, 'get_forecasts', {
type: 'daily',
}).then(function(response) {
// Check that forecasts is in the answer
if (!response || !response.forecasts) {
console.error('No forecast data available');
return;
}
Otherwise the card will show
Please, check your weather entity
Unfortunately, as an old programmer, I'm not good enough in JS to change it myself in a fork.
I just updated to 2024.4.0 and as OToussaint said, the card no longer works.
You can create a template sensor to get the daily (and hourly) forecast. Here is my example for daily. It will create a new sensor which you can add to the card.
- trigger:
- platform: time_pattern
hours: /1
- platform: homeassistant
event: start
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.forecast_gaszowice
response_variable: daily
sensor:
- name: Forecast Gaszowice Daily
state: "{{ states('weather.forecast_gaszowice') }}"
attributes:
temperature: "{{ state_attr('weather.forecast_gaszowice', 'temperature') }}"
dew_point: "{{ state_attr('weather.forecast_gaszowice', 'dew_point') }}"
temperature_unit: "{{ state_attr('weather.forecast_gaszowice', 'temperature_unit') }}"
humidity: "{{ state_attr('weather.forecast_gaszowice', 'humidity') }}"
cloud_coverage: "{{ state_attr('weather.forecast_gaszowice', 'cloud_coverage') }}"
pressure: "{{ state_attr('weather.forecast_gaszowice', 'pressure') }}"
pressure_unit: "{{ state_attr('weather.forecast_gaszowice', 'pressure_unit') }}"
wind_bearing: "{{ state_attr('weather.forecast_gaszowice', 'wind_bearing') }}"
wind_speed: "{{ state_attr('weather.forecast_gaszowice', 'wind_speed') }}"
wind_speed_unit: "{{ state_attr('weather.forecast_gaszowice', 'wind_speed_unit') }}"
visibility_unit: "{{ state_attr('weather.forecast_gaszowice', 'visibility_unit') }}"
precipitation_unit: "{{ state_attr('weather.forecast_gaszowice', 'precipitation_unit') }}"
forecast: "{{ daily['weather.forecast_gaszowice'].forecast }}"
I just updated to 2024.4.0 and as OToussaint said, the card no longer works.
Same here
Im having the same issue.
This hacs integegration works with 2024.4 forecasts https://github.com/mlamberts78/weather-chart-card
This hacs integegration works with 2024.4 forecasts https://github.com/mlamberts78/weather-chart-card
That doesn't seem to show hourly forcasts
This hacs integegration works with 2024.4 forecasts https://github.com/mlamberts78/weather-chart-card
That doesn't seem to show hourly forcasts
Oh, cool! Thanks for correcting me 🙏