Home Assistant weather card YAML: three built-in options
Weather is the most-viewed card on most dashboards, and there are several ways to show it. This page gives YAML for three, all built into Home Assistant: the full forecast card, a compact current-conditions version, and a glance card that uses your own outdoor sensors instead of an online forecast.
Disclosure: Written by the maker of this site. The YAML below parses as valid YAML and uses only built-in Home Assistant cards and options from the official documentation. This exact example has not been run on every Home Assistant version or setup.
Start with a weather entity
All three cards need a weather. entity. If you do not have one, add an integration under Settings, Devices and services. Home Assistant includes free options such as Met.no and, depending on version, others. Whichever you choose, the entity id (for example weather.home) is what goes into the card's entity line.
Option 1: the built-in forecast card
The weather-forecast card is part of Home Assistant. It shows current conditions and a forecast. Useful options are entity, show_current, show_forecast and forecast_type (daily, hourly or twice daily, where the integration supports it). It is maintained with Home Assistant and needs no installation. The tradeoff is size: with the forecast showing it is a large card, which is wasteful on a phone or a crowded overview.
Option 2: a compact version
The same weather-forecast card gets much smaller if you set show_forecast: false. You are left with the current condition, temperature and a few details, which is enough for an overview page, a phone dashboard or a wall tablet. A second card with forecast_type: hourly and show_current: false makes a tidy "next few hours" strip for the same entity.
Option 3: your own sensors
An online forecast cannot know what is happening on your patio. If you have an outdoor temperature sensor or a weather station, a built-in glance card can show your own sensor values in a row: each item is one of your sensor entities, with an optional name. Put it next to the forecast card, so you have the prediction and what your thermometer actually says.
The YAML
Complete example. Paste it into the raw configuration editor of a dashboard, then replace the placeholder entity ids with yours.
title: Weather
views:
- title: Weather
path: weather
icon: mdi:weather-partly-cloudy
type: sections
max_columns: 3
sections:
- type: grid
cards:
- type: heading
heading: Built-in forecast
- type: weather-forecast
entity: weather.home
show_current: true
show_forecast: true
forecast_type: daily
- type: grid
cards:
- type: heading
heading: Compact
- type: weather-forecast
entity: weather.home
show_current: true
show_forecast: false
- type: weather-forecast
entity: weather.home
show_current: false
show_forecast: true
forecast_type: hourly
- type: grid
cards:
- type: heading
heading: My own sensors
- type: glance
title: My station
columns: 3
entities:
- entity: sensor.outdoor_temperature
name: Temp
- entity: sensor.outdoor_humidity
name: Humidity
- entity: sensor.wind_speed
name: Wind
Choosing between them
Use the full forecast card where you have room and want an hourly or daily forecast. Use the compact version on overview pages, phone dashboards and wall tablets, where one card with the current condition is enough. Add the glance row of your own sensors if you have a weather station and you are tired of the forecast being two degrees off.
Whichever you use, keep one weather card per view. Repeating weather in four places does not make the dashboard more useful, it just makes it longer.
Quick answers
Why is the forecast type missing?
Not every weather integration offers every forecast type. If daily does not work, try hourly or leave the option out and use the integration's default.
Can I show a weather alert?
Some integrations expose alerts as separate sensors or entities. If yours does, add it as an entity in an entities card or a banner row next to the weather.
Which units does it use?
The weather entity reports in your Home Assistant unit system, set under Settings, System, General. Change it there rather than on the card.