home-assistant / frontend

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

Thermostat Card - dual mode broken #18959

Closed cociweb closed 8 months ago

cociweb commented 9 months ago

Checklist

Describe the issue you are experiencing

Updating to 2023.12.0 the dual mode functionality is break for the thermostat card. My thermostat uses MQTT HVAC with low / high values. After the upgrade, the new card works only in single mode and uses only the low value. the situation is the same for the entity dialog too.

the new behavior: image

the old (example, illustration from the www) behavior: image

Describe the behavior you expected

restore the dual mode functionality for MQTT HVAC as a drop in replacement of the old thermostat card: Show and set both Low & High temp value on the same card.

Steps to reproduce the issue

  1. upgrade from 2023.11.3 to 2023.12.0
  2. Clear cache
  3. ... As an observation: there are no html elements where the class=".dual" attribute.

What version of Home Assistant Core has the issue?

2023.12.0

What was the last working version of Home Assistant Core?

2023.11.3

In which browser are you experiencing the issue with?

edge, companion app, firefox

Which operating system are you using to run this browser?

Ubuntu 22.04, Android 13

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

appropriate yaml:

mqtt:
  climate:
    - name: "Fűtés"
      unique_id: "climate.futes"
      max_temp: 30
      min_temp: 10
      precision: 0.1
      temp_step: 0.5
      retain: false
      temperature_unit: "C"
      modes:
       - auto
       - heat
       - cool
       - 'off'
      mode_state_template: >-
        {% set value = value_json.opmode.value %}
        {% set values = { 'auto':'auto', 'day':'heat', 'night':'cool', 'off':'off'} %}
        {{ values[value] if value in values.keys() else 'auto' }}
      mode_state_topic:  "ebusd/700/z1OpMode"
      mode_command_template: >-
        {% set values = { 'auto':'auto', 'heat':'day',  'cool':'night', 'off':'off'} %}
        {{ values[value] if value in values.keys() else 'auto' }} 
      mode_command_topic: "ebusd/700/z1OpMode/set"

      temperature_state_template: "{{ value_json.tempv.value }}"
      temperature_state_topic: "ebusd/700/z1ActualRoomTempDesired"
      temperature_command_topic: "ebusd/700/z1ActualRoomTempDesired/set"

      temperature_low_state_template: "{{ value_json.tempv.value }}"
      temperature_low_state_topic: "ebusd/700/z1NightTemp"
      temperature_low_command_topic: "ebusd/700/z1NightTemp/set"

      temperature_high_state_template: "{{ value_json.tempv.value }}"
      temperature_high_state_topic: "ebusd/700/z1DayTemp"
      temperature_high_command_topic: "ebusd/700/z1DayTemp/set"

      current_temperature_template: "{{ value_json.tempv.value }}"
      current_temperature_topic: "ebusd/700/z1RoomTemp"
cociweb commented 8 months ago

This is the corresponding service call:

service: climate.set_temperature
data:
  target_temp_high: 24
  target_temp_low: 22
  hvac_mode: auto
target:
  entity_id: climate.futes
karwosts commented 8 months ago

Can you copy the full attributes of the climate.futes entity from developer tools and list them here?

cociweb commented 8 months ago

image

karwosts commented 8 months ago

I think the issue seems to be that your entity has a temperature attribute simultaneously with target_temp_high and target_temp_low.

If you set temperature to null then I think you'll see the two target temps in the control.

cociweb commented 8 months ago

....ummm.... I've played now a little with the developer tools. I've removed the temperature attribute and the problem solved temporarily: only 2 target temps remained: _low and _high so it seems the old card was buggy as 3 target temp was configurable??? (but I'm pretty sure all of them was settable)

karwosts commented 8 months ago

It's possible this is some undefined corner case where the old card handled differently.

karwosts commented 8 months ago

I looked at how my other thermostats behave and they always set temperature to null when entering heat/cool mode, and they always set target_temp_high/low to null when exiting a dual mode. So that's probably the way to go.

cociweb commented 8 months ago

I think the issue seems to be that your entity has a temperature attribute simultaneously with target_temp_high and target_temp_low.

If you set temperature to null then I think you'll see the two target temps in the control.

exactly that happened! I've removed the

      temperature_state_template: "{{ value_json.tempv.value }}"
      temperature_state_topic: "ebusd/700/z1ActualRoomTempDesired"
      temperature_command_topic: "ebusd/700/z1ActualRoomTempDesired/set"

part from the config, and it works like a charm!

Thank you @karwosts!