Guide: How to Fix Weather Forecasts with the New weather.get_forecasts Service #950
stovedoctor
started this conversation in
Documentation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Edit [September 21, 2025]: This guide has been updated to reflect the new
weather.get_forecasts
service and to provide a more robust solution for both hourly and daily forecasts. It also includes notes on common issues with weather provider integrations.Hello everyone,
Home Assistant has changed the way it provides weather forecast data. The old method of reading the forecast directly from a
weather
entity's attributes is no longer supported. This will cause openHASP panels that display future forecasts to show blank or incorrect data.This guide will walk you through the new, correct method.
Two screen shots of the basic old way weather is shows and the new templates that will show more details of daily and or hourly weather.

Before
After

Important Note on Weather Integrations (like AccuWeather)
Many users have reported ongoing issues with the official AccuWeather integration in Home Assistant. Common problems include the
weather
entity frequently becomingunavailable
or failing to update, which can cause your weather display to appear broken even if your templates are correct.If you are experiencing these issues, I strongly recommend switching to the built-in Met.no integration. It is the default weather provider for Home Assistant and is known to be very stable and reliable. The examples in this guide will use the default
weather.home
entity created by Met.no.Step 1: Create the New Weather Forecast Sensors
You need to add the following code to your
template.yaml
file (or wherever you store your template sensor configurations). This will create two new sensors:sensor.weather_hourly_forecast
andsensor.weather_daily_forecast
.Important: In the code below, you must replace
weather.home
with the actual name of your weather entity (e.g.,weather.accuweather
if yours is working, orweather.home
if you are using Met.no). You can find your entity ID in Settings > Devices & Services > Entities.Add this code to your template.yaml file
A Note on Update Times
In the code above, the hourly forecast updates every 30 minutes (
minutes: "/30"
) and the daily forecast updates every hour (hours: "/1"
). You can adjust these values to your liking. For testing, you might want to temporarily set it to update every minute (minutes: "/1"
) to see your changes quickly, then change it back to a longer interval later to avoid putting unnecessary load on the weather service.Understanding the Forecast:
forecast[0]
,forecast[1]
, etc.A common point of confusion is how to get the forecast for a specific hour or day. The
forecast
attribute is a list, and in programming, lists always start counting from zero.Hourly Forecast (
sensor.weather_hourly_forecast
)forecast[0]
= The current hourforecast[1]
= 1 hour from nowforecast[2]
= 2 hours from nowDaily Forecast (
sensor.weather_daily_forecast
)forecast[0]
= Todayforecast[1]
= Tomorrowforecast[2]
= The day after tomorrowPractical Example
So, when you see a template in your
openhasp.yaml
file like this:yaml
Step 1b: Using Your New Forecast Sensors
Now that you have sensors that hold the forecast data, you can use them in all sorts of useful ways around Home Assistant. Here are a couple of common examples.
Example 1: Dashboard Weather Card
You can use the new
sensor.weather_daily_forecast
with the standard Home Assistant Weather Forecast Card for a clean daily forecast on your dashboard.weather.home
).sensor.weather_daily_forecast
.Card YAML:
yaml
Step 1b: Using Your New Forecast Sensors
Now that you have sensors that hold the forecast data, you can use them in all sorts of useful ways around Home Assistant. Here are a couple of common examples.
Example 1: Dashboard Weather Card
You can use the new
sensor.weather_daily_forecast
with the standard Home Assistant Weather Forecast Card for a clean daily forecast on your dashboard.weather.home
).sensor.weather_daily_forecast
.Card YAML:
Example 2: "Good Morning" Automation
This is a common automation where your smart speaker tells you the forecast for the day when you wake up. This example uses the new
sensor.weather_daily_forecast
to get the high temperature and condition for today.Automation YAML:
Step 2: Update Your openHASP Configuration
Now, you need to edit your
openhasp.yaml
file to tell your display to get its forecast data from these new sensors. You will need to find all the objects related to your weather page and change the templates.Example for an hourly forecast object:
Example for a daily forecast object:
Step 3: Restart Home Assistant
After saving both your
template.yaml
and youropenhasp.yaml
files, you must restart Home Assistant for the changes to take effect.Once restarted, your new sensors will be created, and your openHASP weather page should display all the forecast information correctly. You can verify that your new sensors are working by checking them in Developer Tools > States.

Alternative Method: Creating Individual Template Sensors
The main guide shows how to create a single sensor that stores the entire forecast in an attribute. This is very powerful and efficient. However, some users may prefer to have individual sensors for each piece of data they need (e.g., a sensor just for today's high temperature, or a sensor for tomorrow's condition).
This method can be useful if you only need a few specific forecast values and prefer to have them as separate, simple entities.
Here is an example of how you could create a few individual sensors for today's and tomorrow's forecast in your
template.yaml
file.Sources & Further Reading
My Project & Sources
For more on my personal openHASP project, you can check out my main forum thread and my GitHub repository.
Beta Was this translation helpful? Give feedback.
All reactions