home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.47k stars 29.41k forks source link

Danfoss Z-Wave radiator thermostat does not have HVAC modes #28834

Closed alex3305 closed 3 years ago

alex3305 commented 4 years ago

Home Assistant release with the issue: 0.101.3

Last working Home Assistant release (if known): None

Operating environment (Hass.io/Docker/Windows/etc.): Docker

Integration: https://www.home-assistant.io/integrations/zwave/

Description of problem:

HVAC modes are missing from my Z-Wave Climate entries. Also it seems that preset modes also aren't available. I am using the Popp TRV010101, which is almost the same as the Danfoss LC-13 radiator thermostat.

image

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

None. I have configured Z-Wave completely using Z-Wave Integrations.

image

Traceback (if applicable): None

probot-home-assistant[bot] commented 4 years ago

Hey there @home-assistant/z-wave, mind taking a look at this issue as its been labeled with a integration (zwave) you are listed as a codeowner for? Thanks!

Hooch76 commented 4 years ago

Same here. I've also got a Danfoss / Devolo thermostat where hvac_modes are not populated.

alex3305 commented 4 years ago

I've already mentioned this on the Discord #devs-general channel, but I've created a local version which supports a single hvac_mode:

image

The hvac_action heating is activated when the current temperature is below setpoint, and set to idle when the inverse is true. For now this seems to work, albeit this is a very basic implementation:

image

I would like to get some feedback on this proposed change prior to submitting this as a possible PR.

alex3305 commented 4 years ago

I just realized that the change that I showed in my post above would likely need both the hot_tolerance and cold_tolerance optional configuration variables. At least for the thermostats I use. Those are also used in the Generic Thermostat component.

Hooch76 commented 4 years ago

I would like to get some feedback on this proposed change prior to submitting this as a possible PR.

How did you implement that exactly? "hvac_action" is not present for my thermostat. The reason I would like to have "hvac_mode" (on, heat, cool) available is: I just want to create an easy automation (!) that turns off the thermostat when a window is opened (IOW: windows open -> set hvac_mode to off) and that sets hvac_mode to "heat" when the window is closed again. I want to avoid to just increase or decrease the temperature of the thermostat because setting it to a fixed temperature might interfere with other automations. Is that something your implementation will be able to handle?

bieniu commented 4 years ago

Could you share your version? I can test it with Danfoss LC-13 thermostat. Danfoss doesn't report current_temperature. Could it be a problem?

alex3305 commented 4 years ago

@Hooch76 hvac_modes are not provided by this device. Thus hvac_action will not work. The change I will be proposing will only provide a working hvac_action with a single hvac_mode. With this device that will be the heating mode. That would at least provide us with the current state of the device, which is now completely omitted.

A workaround for your use case would be rather trivial though. You could implement something like this:

input_number:
  last_temp_climate_livingroom:
    name: Last temperature climate living room
    min: 4
    max: 28
    step: 0.5
    unit_of_measurement: °C

input_boolean:
  heating_livingroom_active:
    name: Living room heating

automation:
  - alias: Turn off living room heating
    trigger:
      platform: state
      entity_id: input_boolean.heating_livingroom_active
      to: 'off'
    action:
      - service: input_number.set_value
        data_template:
          entity_id: input_number.last_temp_climate_livingroom
          value: "{{ states.climate.livingroom.attributes.temperature }}"
      - service: climate.set_temperature
        data:
          entity_id: climate.livingroom
          temperature: 4

  - alias: Turn on living room heating
    trigger:
      platform: state
      entity_id: input_boolean.heating_livingroom_active
      to: 'on'
    action:
      service: climate.set_temperature
      data_template:
        entity_id: climate.livingroom
        temperature: "{{ states.input_number.last_temp_climate_livingroom.state }}"

Where you can also use a binary_sensor template for your window or an additional trigger on the automations.

@bieniu That is a widely reported device limitation of the Danfoss LC-13. See also #9478. Only the Popp or Remotec variants return the current temperature.

bieniu commented 4 years ago

I know that. I asked if your solution is somehow related to current_temperature or will it be universal for all radiator thermostats.

alex3305 commented 4 years ago

@bieniu Ah right, I re-read your message and I understand now. The lack of current_temperature could possibly be an issue. Because the hvac_action is dependent on that property.

However I'm currently testing another variant of this proposed change where you will need to set hvac_modes as a customization entry. Omitting to do so, would not change anything to current configuration entries.

bieniu commented 4 years ago

I wrote sometime ago a script that adds hvac_modes (and current_temperature from external sensor) to the thermostat entity. It works but it isn't ideal solution.

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

alex3305 commented 4 years ago

This is still an issue. I haven't looked into it after the recent z-wave climate changes that have been made in #27040. Perhaps it is a good time to again investigate this issue and perhaps come up with a solution.

cgarwood commented 4 years ago

This should be fixed in the new zwave component that's being worked on, may be a few weeks before it's into core though.

m4rkireland commented 4 years ago

Any news on this please?

cgarwood commented 4 years ago

The new component has been merged into core (OpenZWave (beta)) - Please try it out and see if the thermostat works with that component

m4rkireland commented 4 years ago

Thanks, will do!

alex3305 commented 4 years ago

@cgarwood @marcelveldt Thank you both for your great contributions to the new OZW beta integration. Almost everything is working wonderfully now. But it seems that the Idle state is never reached:

image

Perhaps if devices are of type heating with a single setpoint, this behaviour could easily be identified and set? Because this way the Lovelace UI graph is a bit hard to read 😛.

marcelveldt commented 4 years ago

There is no idle mode. Do you perhaps mean idle action ? Not all thermostat devices actually provide their state btw.

alex3305 commented 4 years ago

@marcelveldt Yeah I meant idle action. My Danfoss Popp TRV indeed doesn't provide HVAC modes or actions for that matter. But you have solved that with setting the HVAC mode to heating only.

Although this solution is great, because now it is even possible to control the TRV from Google Home (which wasn't possible before). The side effect is that the TRV HVAC action is never set to idle (heating):

image

My guess is that if we already define single setpoint TRV's without any HVAC modes as heating only entities. It would also be rather nice to make them display the current HVAC action properly.

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

alex3305 commented 3 years ago

This is still an issue with the latest Home Assistant.

discordianfish commented 3 years ago

I hoped https://github.com/home-assistant/core/pull/45065 might fix this, but it doesn't. I still get this:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyhap/hap_server.py", line 600, in handle_set_characteristics
    self.accessory_handler.set_characteristics(requested_chars,
  File "/usr/local/lib/python3.8/site-packages/pyhap/accessory_driver.py", line 745, in set_characteristics
    service_callbacks[aid][service_name][SERVICE_CALLBACK](
  File "/usr/src/homeassistant/homeassistant/components/homekit/type_thermostats.py", line 254, in _set_chars
    homekit_hvac_mode = HC_HASS_TO_HOMEKIT[hvac_mode]
KeyError: 'unknown'

...when trying to set my thermostat from homekit.

bikeymouse commented 3 years ago

Using: Core-2021.3.4 with ZWaveJS2MQTT integration, and Scheduler Card version: 2.05:

I'm not sure If this is related, but I'm also getting HVAC-related errors using my Popp "POPE010101" thermostat with the Scheduler Card:

Error executing service: <ServiceCall climate.set_hvac_mode (c:f1bcab1ef24bbe11b6f1639863e91e06): hvac_mode=heat, entity_id=['climate.thermostat_sleepingroom']>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1504, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1523, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 642, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 681, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 679, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/zwave_js/climate.py", line 404, in async_set_hvac_mode
    raise ValueError(
ValueError: Thermostat climate.thermostat_sleepingroom does not support setting a mode

It seems however that the thermostat is having a "HVAC mode", but apparently it can not be set. It is aways "heat", so the scheduler probably should try to set it.

hvac_modes: heat
min_temp: 7
max_temp: 35
preset_modes: 
current_temperature: 18.9
temperature: 20
preset_mode: none
friendly_name: Thermostat Sleeping Room
supported_features: 17
github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.