diff --git a/src/panels/lovelace/cards/hui-thermostat-card.ts b/src/panels/lovelace/cards/hui-thermostat-card.ts index d78318531f..64c0c54714 100644 --- a/src/panels/lovelace/cards/hui-thermostat-card.ts +++ b/src/panels/lovelace/cards/hui-thermostat-card.ts @@ -132,27 +132,30 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { > `; - const currentTemperature = !isNaN(stateObj.attributes.current_temperature) - ? svg` - - - ${formatNumber( - stateObj.attributes.current_temperature, - this.hass!.language - )} - - ${this.hass.config.unit_system.temperature} - - - - ` - : ""; + const currentTemperature = svg` + + + ${ + stateObj.attributes.current_temperature !== null && + !isNaN(stateObj.attributes.current_temperature) + ? svg`${formatNumber( + stateObj.attributes.current_temperature, + this.hass!.language + )} + + ${this.hass.config.unit_system.temperature} + ` + : "" + } + + + `; const setValues = svg`