home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.07k stars 2.79k forks source link

Thermostat/Humidifier Not showing temp when "show current temperature as primary information" enabled and device is off #19271

Closed MichaelStruck closed 10 months ago

MichaelStruck commented 10 months ago

Checklist

Describe the issue you are experiencing

As the title outlines, when using 2024.1 and enabling "show current temperature as primary information" on the dashboard, the current temperature is NOT shown when the device is off.

Describe the behavior you expected

The expected result is that the temperature of the device is always shown, and that the status would be below it. Basically swapped from the original config.

Steps to reproduce the issue

  1. Update to 2024.1
  2. Add thermostat to dashboard
  3. Enable the 'show current temperature as primary information'
  4. Have the thermostat turned off. The current temperature is not shown

With the new current temp setting off: image

With the new setting on...I would expect it would still show the temperature and 'off' below the temp: image

What version of Home Assistant Core has the issue?

2024.1.0

What was the last working version of Home Assistant Core?

none

In which browser are you experiencing the issue with?

All

Which operating system are you using to run this browser?

Windows 11

State of relevant entities

N/A

Problem-relevant frontend configuration

N/A

Javascript errors shown in your browser console/inspector

N/A

Additional information

N/A

piitaya commented 10 months ago

Can you provide the state and the attributes of your entity when on and when off ?

MichaelStruck commented 10 months ago

Sure... image

In this case, the room temperature is 69, and the setpoint is 68. My expectation would be when it was off you would see the nothing at the top, the current temperature on the middle, and instead of a set point, either nothing, or the words off...instead, this is what it looks like when the thermostat is off. image

The 'goal' would be to use the thermostat (when off) as a temperature reading for the room only

karwosts commented 10 months ago

Here's a complete example:

state: off attributes:

hvac_modes: off, heat, cool, heat_cool
min_temp: 44.6
max_temp: 95
fan_modes: Auto low, Low
preset_modes: none, Auxiliary
current_temperature: 69
temperature: null
target_temp_high: null
target_temp_low: null
fan_mode: Auto low
hvac_action: idle
preset_mode: none
fan_state: Idle / off
friendly_name: Thermostat 
supported_features: 27

state: heat attributes:

hvac_modes: off, heat, cool, heat_cool
min_temp: 44.6
max_temp: 95
fan_modes: Auto low, Low
preset_modes: none, Auxiliary
current_temperature: 69
temperature: 69
target_temp_high: null
target_temp_low: null
fan_mode: Auto low
hvac_action: idle
preset_mode: none
fan_state: Idle / off
friendly_name: Thermostat 
supported_features: 27

Card yaml:

type: thermostat
entity: climate.thermostat
show_current_as_primary: true

Card off: image

Card heat image

karwosts commented 10 months ago

Missing renderPrimary here:

https://github.com/home-assistant/frontend/blob/0d8c0ac1a0c84cee9d1e14f1bc306b8424294c7d/src/state-control/climate/ha-state-control-climate-temperature.ts#L514

piitaya commented 10 months ago

I like take a look.

What integration are you using? In general, climate entity doesn't have temperature set to null when off.

blacknell commented 10 months ago

Here are my two Nest thermostats - the one that's off 'should' show current temperature

image
blacknell commented 10 months ago

This one is a generic thermostat

image
  - platform: generic_thermostat
    name: Cloakroom
    unique_id: thermostat.wc_heater
    heater: switch.cloakroom_heater_outlet
    target_sensor: sensor.cloakroom_temperature
    cold_tolerance: 2
    hot_tolerance: 0.5
    min_temp: 12
    max_temp: 23
    target_temp_step: 0.5
    min_cycle_duration:
      minutes: 5
    precision: 0.1
    comfort_temp: 22
    target_temp: 22
    initial_hvac_mode: "off"
zolakt commented 10 months ago

Fully support this issue. I'm having it with all of my thermostat (Tuya TRVs, better thermostat, humidifiers...) Most of them set "temperature" to null when they are turned off.

Although, I don't see why would that be relevant anyway. The "temperature" attribute is the target temperature. The "current_temperature" needs to be always shown, not the target. This is regardless if you have the new "show current as primary" option on or off. The off state is a replacement for the thermostat/target temperature. They are mutually exclusive, either it's off or it has a target set. The thermometer/current temperature has nothing to do with this. It doesn't depend on the state, and should always be shown.

piitaya commented 10 months ago

The current frontend implementation doesn't support current temperature display if the thermostat doesn't support target temperature (by setting temperature to null the front-end assume that target temperature is not supported). My thermostat (overkiz, esphome and demo) doesn't remove temperature when off so I didn't handle this case.

This issue will be addressed 🙂

zolakt commented 10 months ago

The current frontend implementation doesn't support current temperature display if the thermostat doesn't support target temperature (by setting temperature to null the front-end assume that target temperature is not supported).

I'm not really following you here. How does it work then if you don't select "show current temp as primary"? It shows "off" instead of the primary/target temperature, and shows the current temperature as secondary bellow it. The same thermostats that set the "temperature" to null when it's off.

piitaya commented 10 months ago

I only explain how the current implementation works but it's a bug. It will be fixed and current temperature will be displayed even if show current temp as primary is active.