Weather
custom:weather-card-pro shows one weather entity, as a tile or as a card built from sections: the current weather large, trend charts and the forecast. For one value drawn large, a poster of the weather kind is the simpler choice.
The tile
The entity alone makes a tile: the condition's picture, the name, and the temperature and condition on the line under it.
Sections
With sections, the card draws them in the order you write them. Each section takes a title above it, divider: true for a line above it, and visibility, whose conditions read the weather entity unless they name another.
hero: the condition, the temperature large, and today's high and low.trend: a chart of the hourly or daily forecast.forecast: the next hours or days, as rows or columns.
The entity sections (row, list, table, grid, column) still work and go in 4.0: put a tile group beside the card instead (see below).
Hero
The hero section's name puts your own words on its first line (the condition then moves to the second), and secondary replaces the second line. Both take templates and default to the card's name and secondary.
Values beside the weather
For more values than the condition and the temperature, put a tile group beside the card in a layout card: its tiles show any sensor with its own kind, rules and controls.
Trend
A trend section charts the forecast as the multi trend card does. mode: hourly shows the next hours hours, mode: daily the next days days, with the temperature as high and low. show lists the lines: temperature, precipitation, probability and wind, or { quantity, name, color }. Hover or touch the chart for the condition and every value at that time.
Forecast
A forecast section lists the next days or hours: the weekday or time, the condition, the rain figures of show and the temperature. Days get a bar from the low to the high, on one scale for all days, so a warm day stands out. layout: horizontal turns the rows into columns.
Icons
The conditions are drawn with the pictures of Home Assistant's own weather card, coloured by the theme's --weather-icon-* variables. icons: mdi uses the mdi weather icons instead. A map sets an icon per condition: an mdi: icon or an image URL (/local/weather/rain.svg); conditions left out keep the pictures. icons on a hero or forecast section merges over the card's. icon_size sets the icon's size in pixels, on the card for the tile and on a section for its own.
Rules and colours
rules match the condition (state: rainy) and set the colour, the icon and a status, or tint the whole card with tint_card: true. temperature_rules match the temperature with below and above: they colour the value, the temperature line and the forecast bars, with their status beside the high and low. A hero, trend or forecast section can carry its own rules and temperature_rules, which replace the card's for that section. The first matching rule wins.
Header
title and icon add a header, and badges puts badges in it, with a badge's keys. The old header_entities still work until 4.0; see Moving to 3.0.
The visual editor
Home Assistant's card editor has every option. The sections are a list, each in a form of its type. Try it in the Playground, or with Edit under any example.
Reference
Conditions
Home Assistant's fifteen conditions: the keys of an icons map and the state a rule matches. The name is what the card shows, in the profile language.
state | Name | icons: mdi |
|---|---|---|
clear-night | Clear night | mdi:weather-night |
cloudy | Cloudy | mdi:weather-cloudy |
exceptional | Exceptional | mdi:alert-circle-outline |
fog | Fog | mdi:weather-fog |
hail | Hail | mdi:weather-hail |
lightning | Lightning | mdi:weather-lightning |
lightning-rainy | Thunderstorms | mdi:weather-lightning-rainy |
partlycloudy | Partly cloudy | mdi:weather-partly-cloudy |
pouring | Pouring | mdi:weather-pouring |
rainy | Rainy | mdi:weather-rainy |
snowy | Snowy | mdi:weather-snowy |
snowy-rainy | Sleet | mdi:weather-snowy-rainy |
sunny | Sunny | mdi:weather-sunny |
windy | Windy | mdi:weather-windy |
windy-variant | Windy | mdi:weather-windy-variant |
sunny and partlycloudy show their night icon while the sun is down; forecast days always show the day icon. A condition not in this list is shown as written, with a question mark icon.
Card options
| Key | Default | Description |
|---|---|---|
entity | – | The weather entity. Required. |
sections | – | The sections, drawn in this order. Without them the card is a tile. |
name | the friendly name | The tile's name, or the hero's first line. Template allowed. |
secondary | see description | The line under the name (tile: temperature · condition; hero: status · high / low). Template allowed. |
color | primary | A fixed colour for the condition; wins over the rules until 4.0, when a matching rule's colour wins, as on the tile. |
icon_style | circle | plain draws the tile's and the hero's icon without its circle. |
decimals | as reported | Decimals of the temperature, 0 to 3. |
icons | hass | hass (Home Assistant's pictures), mdi, or a map from condition to an mdi: icon or image URL. |
icon_size | 36 | The tile's icon size in pixels. |
rules | – | Rules on the condition: color, icon, status, tint_card. See Rules. |
temperature_rules | – | Rules on the temperature (below, above): color, status, tint_card. |
title, icon | – | The header's text and icon. Template allowed. |
badges | – | The header's badges: entity ids or badges. |
header_entities | – | The old header badges, until 4.0; see Moving to 3.0. |
title_tap_action | none | What a tap on the title or its icon does, such as { action: navigate, navigation_path: /lovelace/weather }. |
tap_action, hold_action | more-info | What a tap or hold on the tile or hero does, and the default for every entity; see Actions. |
double_tap_action | none | What a double tap does, and the default for every entity. |
hover | true | Home Assistant's hover and press effects, as on the tile; false turns them off for every section. |
Section hero
| Key | Default | Description |
|---|---|---|
name, secondary | the card's | The first and second line. Template allowed. |
icons | the card's | Condition icons for this section, merged over the card's. |
icon_size | 56 | The icon's size in pixels. |
rules, temperature_rules | the card's | Rules for this section only. |
title | – | The text above the section. |
divider | false | A line above the section. |
visibility | – | Conditions that show or hide the section. |
Section trend
| Key | Default | Description |
|---|---|---|
mode | daily | hourly or daily. |
hours, days | 12, 7 | 1 to 48 hours from now, or 1 to 10 days from today. |
show | [temperature, precipitation] | The lines in order: temperature, precipitation, probability, wind, or { quantity, name, color }. wind_speed and precipitation_probability also work. |
layout | auto | overlay (one chart), lanes (one per line), or auto: overlaid when the lines share a unit. |
x_axis | true | Time labels and gridlines. |
y_axis | false | Value labels and gridlines. |
show_legend | true | A legend when lines are overlaid. |
rules, temperature_rules | the card's | Rules for this section only. |
title | "Next 12 hours", "7 days" | The text above the section. |
divider | false | A line above the section. |
visibility | – | Conditions that show or hide the section. |
Section forecast
| Key | Default | Description |
|---|---|---|
mode | daily | hourly or daily. |
layout | vertical | vertical (rows) or horizontal (columns). |
hours, days | 12, 7 | 1 to 48 hours from now, or 1 to 10 days from today. |
show | [probability] | Rain figures per row: probability, precipitation; [] for none. |
icons | the card's | Condition icons for this section, merged over the card's. |
icon_size | 22 | The icons' size in pixels. |
rules, temperature_rules | the card's | Rules for this section only. |
title | "Next 12 hours", "7 days" | The text above the section. |
divider | false | A line above the section. |
visibility | – | Conditions that show or hide the section. |
The forecast is the one Home Assistant's own weather card shows, in the entity's units; a twice-daily forecast is summarised per day. A section whose forecast the entity does not provide says so.
Deprecated: entity sections
The row, list, table, grid and column sections list entities: an attribute of the weather entity (humidity, pressure, wind_speed, wind_gust_speed, wind_bearing, apparent_temperature, dew_point, uv_index, cloud_coverage, visibility, ozone, with a translated name, an icon and the entity's unit) or an entity with the older entity options. They still work, say so once in the browser console, and go in 4.0 with the card options that set them (the first table); put a tile group beside the card in a layout card instead (see above and Moving to 3.0).
| Key | Default | Description |
|---|---|---|
columns, align | per layout | Defaults for the entity sections. |
show_name, show_value, show_icon | per layout | Defaults for the entity sections' items. |
name_position | below | above or below the icon, in row items. |
hours_to_show, bucket_minutes | 24, 60 | History window and bucket of sparklines, columns and strips in entity sections. |
smoothing_minutes | one point per 12 px | Averaging of sparklines in entity sections, in minutes. |
A section of this kind takes:
| Key | Default | Description |
|---|---|---|
entities | – | Weather attribute names, entity ids or entities; an entry without entity reads the weather entity's attribute. Required. |
layout | list | The layout when type is left out, as in a section copied from elsewhere. |
columns | the card's | grid: cells per row, 1 to 4. |
align | the card's | How the items spread; row items stretch over the width. |
show_name, show_value, show_icon | the card's | Show or hide the items' parts; row items show their value. |
name_position | the card's | above or below the icon, in row items. |
hover | the card's | Hover and press effects for this section's entities. |
title | – | The text above the section. |
divider | false | A line above the section. |
visibility | – | Conditions that show or hide the section. |
Grid and Home Assistant options
As a tile the card takes 6 columns (at least 3); with sections it takes 12 (at least 6). Both size their height to their content (rows: auto). The card also takes Home Assistant's grid_options, visibility, view_layout, layout_options, card_mod and uix, and fill_height: false keeps its own height beside a taller card (Filling the height).