Skip to content

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.

Edit

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.

Edit

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.

Edit

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.

Edit

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.

Edit

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.

Edit

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.

Edit

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.

Edit

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.

stateNameicons: mdi
clear-nightClear nightmdi:weather-night
cloudyCloudymdi:weather-cloudy
exceptionalExceptionalmdi:alert-circle-outline
fogFogmdi:weather-fog
hailHailmdi:weather-hail
lightningLightningmdi:weather-lightning
lightning-rainyThunderstormsmdi:weather-lightning-rainy
partlycloudyPartly cloudymdi:weather-partly-cloudy
pouringPouringmdi:weather-pouring
rainyRainymdi:weather-rainy
snowySnowymdi:weather-snowy
snowy-rainySleetmdi:weather-snowy-rainy
sunnySunnymdi:weather-sunny
windyWindymdi:weather-windy
windy-variantWindymdi: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 ​

KeyDefaultDescription
entity–The weather entity. Required.
sections–The sections, drawn in this order. Without them the card is a tile.
namethe friendly nameThe tile's name, or the hero's first line. Template allowed.
secondarysee descriptionThe line under the name (tile: temperature · condition; hero: status · high / low). Template allowed.
colorprimaryA fixed colour for the condition; wins over the rules until 4.0, when a matching rule's colour wins, as on the tile.
icon_stylecircleplain draws the tile's and the hero's icon without its circle.
decimalsas reportedDecimals of the temperature, 0 to 3.
iconshasshass (Home Assistant's pictures), mdi, or a map from condition to an mdi: icon or image URL.
icon_size36The 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_actionnoneWhat a tap on the title or its icon does, such as { action: navigate, navigation_path: /lovelace/weather }.
tap_action, hold_actionmore-infoWhat a tap or hold on the tile or hero does, and the default for every entity; see Actions.
double_tap_actionnoneWhat a double tap does, and the default for every entity.
hovertrueHome Assistant's hover and press effects, as on the tile; false turns them off for every section.

Section hero ​

KeyDefaultDescription
name, secondarythe card'sThe first and second line. Template allowed.
iconsthe card'sCondition icons for this section, merged over the card's.
icon_size56The icon's size in pixels.
rules, temperature_rulesthe card'sRules for this section only.
title–The text above the section.
dividerfalseA line above the section.
visibility–Conditions that show or hide the section.

Section trend ​

KeyDefaultDescription
modedailyhourly or daily.
hours, days12, 71 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.
layoutautooverlay (one chart), lanes (one per line), or auto: overlaid when the lines share a unit.
x_axistrueTime labels and gridlines.
y_axisfalseValue labels and gridlines.
show_legendtrueA legend when lines are overlaid.
rules, temperature_rulesthe card'sRules for this section only.
title"Next 12 hours", "7 days"The text above the section.
dividerfalseA line above the section.
visibility–Conditions that show or hide the section.

Section forecast ​

KeyDefaultDescription
modedailyhourly or daily.
layoutverticalvertical (rows) or horizontal (columns).
hours, days12, 71 to 48 hours from now, or 1 to 10 days from today.
show[probability]Rain figures per row: probability, precipitation; [] for none.
iconsthe card'sCondition icons for this section, merged over the card's.
icon_size22The icons' size in pixels.
rules, temperature_rulesthe card'sRules for this section only.
title"Next 12 hours", "7 days"The text above the section.
dividerfalseA 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).

KeyDefaultDescription
columns, alignper layoutDefaults for the entity sections.
show_name, show_value, show_iconper layoutDefaults for the entity sections' items.
name_positionbelowabove or below the icon, in row items.
hours_to_show, bucket_minutes24, 60History window and bucket of sparklines, columns and strips in entity sections.
smoothing_minutesone point per 12 pxAveraging of sparklines in entity sections, in minutes.

A section of this kind takes:

KeyDefaultDescription
entities–Weather attribute names, entity ids or entities; an entry without entity reads the weather entity's attribute. Required.
layoutlistThe layout when type is left out, as in a section copied from elsewhere.
columnsthe card'sgrid: cells per row, 1 to 4.
alignthe card'sHow the items spread; row items stretch over the width.
show_name, show_value, show_iconthe card'sShow or hide the items' parts; row items show their value.
name_positionthe card'sabove or below the icon, in row items.
hoverthe card'sHover and press effects for this section's entities.
title–The text above the section.
dividerfalseA 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).

Released under the MIT License.