diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts
index 576b908636..76688e0c56 100644
--- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts
+++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts
@@ -200,7 +200,20 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {
>
- ${getSecondaryWeatherAttribute(this.hass, stateObj)}
+ ${this._config.secondary_info_attribute !== undefined
+ ? html`
+ ${this.hass!.localize(
+ `ui.card.weather.attributes.${this._config.secondary_info_attribute}`
+ )}
+ ${stateObj.attributes[
+ this._config.secondary_info_attribute
+ ]}
+ ${getWeatherUnit(
+ this.hass,
+ this._config.secondary_info_attribute
+ )}
+ `
+ : getSecondaryWeatherAttribute(this.hass, stateObj)}
diff --git a/src/panels/lovelace/cards/types.ts b/src/panels/lovelace/cards/types.ts
index 5dd1c46ac1..1d3fbea65b 100644
--- a/src/panels/lovelace/cards/types.ts
+++ b/src/panels/lovelace/cards/types.ts
@@ -275,4 +275,5 @@ export interface WeatherForecastCardConfig extends LovelaceCardConfig {
entity: string;
name?: string;
show_forecast?: boolean;
+ secondary_info_attribute?: string;
}
diff --git a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts
index e4f9ab4815..3ec4e4397f 100644
--- a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts
+++ b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts
@@ -22,6 +22,7 @@ const cardConfigStruct = struct({
name: "string?",
theme: "string?",
show_forecast: "boolean?",
+ secondary_info_attribute: "string?",
});
const includeDomains = ["weather"];
@@ -54,6 +55,10 @@ export class HuiWeatherForecastCardEditor extends LitElement
return this._config!.show_forecast || true;
}
+ get _secondary_info_attribute(): string {
+ return this._config!.secondary_info_attribute || "";
+ }
+
protected render(): TemplateResult {
if (!this.hass || !this._config) {
return html``;
@@ -93,12 +98,26 @@ export class HuiWeatherForecastCardEditor extends LitElement
@value-changed=${this._valueChanged}
>
- Show forecast
+
+
+
${this.hass.localize(
+ "ui.panel.lovelace.editor.card.weather.show_forecast"
+ )}
+
`;
}
diff --git a/src/translations/en.json b/src/translations/en.json
index eee160588a..18d2068be9 100755
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -1841,7 +1841,8 @@
"no_theme": "No theme",
"unit": "Unit",
"url": "Url",
- "state": "State"
+ "state": "State",
+ "secondary_info_attribute": "Secondary Info Attribute"
},
"map": {
"name": "Map",
@@ -1902,7 +1903,8 @@
},
"weather-forecast": {
"name": "Weather Forecast",
- "description": "The Weather Forecast card displays the weather. Very useful to include on interfaces that people display on the wall."
+ "description": "The Weather Forecast card displays the weather. Very useful to include on interfaces that people display on the wall.",
+ "show_forecast": "Show Forecast"
}
},
"view": {