Home Assistant Weather Forecast
I’ve been using Home Assistant for quite some time now but never really bothered with weather forecasts. I was always happy with just the “Meteorologisk institutt (Met.no)” card on my dashboard.
But I have a need for daily forecasts, and I read the Home Assistant actually does not give it to you anymore right out of the box, you have to create a template for it.
Met.no Weather Forecast Attributes
I first wanted to see what attributes the Met.no integration exposes. To see this, go to Developer Tools and then put this into template:
{{ states.weather.forecast_home_2.attributes }}
Output:
{
'temperature': 22.8,
'dew_point': 10.7,
'temperature_unit': '°C',
'humidity': 46,
'cloud_coverage': 89.1,
'uv_index': 2.1,
'pressure': 1011.3,
'pressure_unit': 'mbar',
'wind_bearing': 298.3,
'wind_speed': 17.3,
'wind_speed_unit': 'km/h',
'visibility_unit': 'km',
'precipitation_unit': 'mm',
'attribution': 'Weather forecast from met.no, delivered by the Norwegian Meteorological Institute.',
'friendly_name': 'Forecast Home',
'supported_features': < WeatherEntityFeature.FORECAST_DAILY | FORECAST_HOURLY: 3 >
}
Pirateweather Weather Forecast Attributes
https://docs.pirateweather.net/en/latest/ha
Pirateweather is amazing, it gives you much more information which we will soon see once we create forecasts in our configuration.yaml.
And it is free, but support the developer or don’t pull too often so we don’t overload his infrastructure.
Lets check the integration’s attributes:
{{ states.weather.pirateweather.attributes }}
Output:
{
'temperature': 21.6,
'apparent_temperature': 18.8,
'dew_point': 11.5,
'temperature_unit': '°C',
'humidity': 29,
'ozone': 290.31,
'cloud_coverage': 46.0,
'pressure': 1011.85,
'pressure_unit': 'mbar',
'wind_bearing': 331,
'wind_gust_speed': 15.77,
'wind_speed': 14.0,
'wind_speed_unit': 'km/h',
'visibility': 16.09,
'visibility_unit': 'km',
'precipitation_unit': 'mm',
'attribution': 'Powered by Pirate Weather',
'friendly_name': 'PirateWeather',
'supported_features': < WeatherEntityFeature.FORECAST_DAILY | FORECAST_HOURLY | FORECAST_TWICE_DAILY: 7 >
}
As we can see both integrations return pretty much the same attributes. I guess this is a Home Assistant thing. But lets get the actual forecast data and see if they return something different..
Configuration.yaml Template
Now in order to get the actual forecast using weather.get_forecasts, we need to go to our configuration.yaml and add a template. Here is what the code does (full code at the end):

- The green block says when this template section should run. It will run when Home Assistant starts and then every 40 minutes.
- The orange block tells Home Assistant to use the “weather.get_forecasts” services, and pull the daily forecasts.
- We then tell it we want to use the “weather.pirateweather” entity for this.
- And we put the response into a variable called “daily”.
- In the lighter orange block just below it we create a new sensor called “pirate_weather_today_temperature_new”.
- And we put all the attributes into the attribute value “forecast_today”
- In the big blue block we do the same thing, but for Met.no.
Pull attribute values
Back in developer tools in templates, paste this value. This will get the values from the met.no sensor we created in the blue block:
{{ state_attr('sensor.met_today_temperature', 'forecast_today_met') }}
Output:
{
'condition': 'rainy',
'datetime': '2025-11-24T10:00:00+00:00',
'wind_bearing': 310.2,
'uv_index': 12.9,
'temperature': 20.5,
'templow': 13.4,
'wind_speed': 22.0,
'precipitation': 17.0,
'humidity': 77
}
Now lets do the same thing for the Pirate Weather sensor we created:
{{ state_attr('sensor.pirate_weather_today_temperature_new', 'forecast_today') }}
Output:
{
'datetime': '2025-11-23T22:00:00+00:00',
'condition': 'rainy',
'precipitation_probability': 100.0,
'cloud_coverage': 80.0,
'wind_bearing': 73.0,
'temperature': 22.1,
'templow': 12.4,
'wind_gust_speed': 20.66,
'wind_speed': 12.89,
'precipitation': 19.9,
'humidity': 77
}
We get more information about the percipitation and cloud coverage, and wind gusts. The percipitation_probability is what I was looking for.
You can do this for hourly as well.
Template Code
template:
- sensor:
......
# Get pirateweather weather as it gives forecast values properly
- trigger:
# run at HA start and then every 40 minutes (minute 0 and 40 of each hour)
- platform: homeassistant
event: start
- platform: time_pattern
minutes: "/40"
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.pirateweather
# the result will be available to the template below as the "daily" variable
response_variable: daily
sensor:
- name: "Pirate Weather Today Temperature New"
unique_id: pirate_weather_today_temperature_new
# State = temperature for the first forecast day (index 0 = yesterday, index 1 = today — adjust index as needed)
state: "{{ daily['weather.pirateweather'].forecast[1].temperature }}"
unit_of_measurement: "°C"
attributes:
# also store the whole daily forecast array as an attribute for further templating
forecast_today: "{{ daily['weather.pirateweather'].forecast[1] }}"
# Get forecast_home_2 weather as it gives forecast values properly
- trigger:
# run at HA start and then every 40 minutes (minute 0 and 40 of each hour)
- platform: homeassistant
event: start
- platform: time_pattern
minutes: "/40"
action:
- service: weather.get_forecasts
data:
type: daily2
target:
entity_id: weather.forecast_home_2
# the result will be available to the template below as the "daily2" variable
response_variable: daily2
sensor:
- name: "Met Today Temperature"
unique_id: met_today_temperature
# State = temperature for the first forecast day (index 0 = yesterday, index 1 = today — adjust index as needed)
state: "{{ daily2['weather.forecast_home_2'].forecast[1].temperature }}"
unit_of_measurement: "°C"
attributes:
# also store the whole daily2 forecast array as an attribute for further templating
forecast_today_met: "{{ daily2['weather.forecast_home_2'].forecast[1] }}"