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 becoming unavailable 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 and sensor.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, or weather.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
yaml
# Sensor to fetch and store the HOURLY weather forecast
- trigger:
- platform: time_pattern
minutes: "/30" # Update every 30 minutes
- platform: homeassistant
event: start
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.home # <-- CHANGE THIS to your weather entity
response_variable: hourly
sensor:
- name: "Weather Hourly Forecast"
unique_id: weather_hourly_forecast
state: "{{ now().isoformat() }}"
attributes:
forecast: "{{ hourly['weather.home'].forecast }}" # <-- CHANGE THIS to match
# Sensor to fetch and store the DAILY weather forecast
- trigger:
- platform: time_pattern
hours: "/1" # Update every hour
- platform: homeassistant
event: start
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.home # <-- CHANGE THIS to your weather entity
response_variable: daily
sensor:
- name: "Weather Daily Forecast"
unique_id: weather_daily_forecast
state: "{{ now().isoformat() }}"
attributes:
forecast: "{{ daily['weather.home'].forecast }}" # <-- CHANGE THIS to match
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 now- …and so on.
Daily Forecast (sensor.weather_daily_forecast)
forecast[0]= Todayforecast[1]= Tomorrowforecast[2]= The day after tomorrow- …and so on.
Practical Example
So, when you see a template in your openhasp.yaml file like this:
yaml
# This gets the high temperature for tomorrow:
"{{ state_attr('sensor.weather_daily_forecast','forecast')[1].temperature }}"
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.
- On your dashboard, click “Add Card”.
- Search for and select the Weather Forecast card.
- For the main “Entity”, choose your original weather entity (e.g.,
weather.home). - Check the box for “Secondary Info Entity” and select your new
sensor.weather_daily_forecast.
Card YAML:
yaml
type: weather-forecast
entity: weather.home
show_forecast: true
secondary_info_entity: sensor.weather_daily_forecast
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:
- alias: "Good Morning Weather Announcement"
id: good_morning_weather_announcement
trigger:
# Trigger this however you like, e.g., when you turn off your alarm
- platform: state
entity_id: input_boolean.wake_up
to: 'on'
action:
# This creates variables to make the message easier to read
- variables:
todays_forecast: "{{ state_attr('sensor.weather_daily_forecast', 'forecast')[0] }}"
high_temp: "{{ todays_forecast.temperature }}"
condition: "{{ todays_forecast.condition | replace('-', ' ') }}"
# This sends the message to a smart speaker
- service: tts.google_say
target:
entity_id: media_player.living_room_speaker #<-- Change to your speaker
data:
message: >
Good morning! The forecast for today is {{ condition }},
with a high of {{ high_temp }} degrees.
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:
- OLD CODE:
- obj: "p5b22" # Forecast temp +1h properties: "text": "{{ state_attr('weather.home','forecast')[1]['temperature'] }}" - NEW CODE:
- obj: "p5b22" # Forecast temp +1h properties: "text": "{{ state_attr('sensor.weather_hourly_forecast','forecast')[1].temperature }}"
Example for a daily forecast object:
- OLD CODE:
- obj: "p5b63" # Forecast temp max +1d properties: "text": "{{ state_attr('weather.home','forecast')[1]['temperature'] }}" - NEW CODE:
- obj: "p5b63" # Forecast temp max +1d properties: "text": "{{ state_attr('sensor.weather_daily_forecast','forecast')[1].temperature }}"
Step 3: Restart Home Assistant
After saving both your template.yaml and your openhasp.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.
# Add this code to your template.yaml file for individual sensors
- trigger:
- platform: time_pattern
hours: "/1"
- platform: homeassistant
event: start
action:
# Get the daily forecast and store it in a variable
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.home # <-- CHANGE THIS to your weather entity
response_variable: daily
# Create variables for today's and tomorrow's forecast for easier use
- variables:
today: "{{ daily['weather.home'].forecast[0] }}"
tomorrow: "{{ daily['weather.home'].forecast[1] }}"
sensor:
# --- Sensors for Today's Forecast ---
- name: "Forecast High Temp Today"
unique_id: forecast_high_temp_today
state: "{{ today.temperature }}"
unit_of_measurement: "°F"
- name: "Forecast Low Temp Today"
unique_id: forecast_low_temp_today
state: "{{ today.templow }}"
unit_of_measurement: "°F"
- name: "Forecast Condition Today"
unique_id: forecast_condition_today
state: "{{ today.condition }}"
# --- Sensors for Tomorrow's Forecast ---
- name: "Forecast High Temp Tomorrow"
unique_id: forecast_high_temp_tomorrow
state: "{{ tomorrow.temperature }}"
unit_of_measurement: "°F"
- name: "Forecast Condition Tomorrow"
unique_id: forecast_condition_tomorrow
state: "{{ tomorrow.condition }}"
Sources & Further Reading
- Home Assistant Blog Post: Weather forecast service
- Developer Documentation: HA dev Weather forecasts
My Project & Sources
For more on my personal openHASP project, you can check out my main forum thread and my GitHub repository.
- My Main openHASP Forum Thread: Openhasp on a Lanbon L8 and WT32-SC01 Plus
- My openHASP GitHub Repository: github.com/stovedoctor/openhasp-





