KartoffelToby / better_thermostat

This custom component for Home Assistant will add crucial features to your climate-controlling TRV (Thermostatic Radiator Valves) to save you the work of creating automations to make it smart. It combines a room-temperature sensor, window/door sensors, weather forecasts, or an ambient temperature probe to decide when it should call for heat and automatically calibrate your TRVs to fix the imprecise measurements taken in the radiator's vicinity.
https://better-thermostat.org
GNU Affero General Public License v3.0
866 stars 129 forks source link

Danfoss POPP Thermostate not working #700

Closed samuelbagforsprivat closed 1 year ago

samuelbagforsprivat commented 1 year ago

Prerequisites

using z-wave JS, everything on the latest released versions.


{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.11.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.7",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Stockholm",
    "os_name": "Linux",
    "os_version": "5.15.74",
    "supervisor": "2022.11.2",
    "host_os": "Home Assistant OS 9.3",
    "docker_version": "20.10.18",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "chargeamps": {
      "version": "1.7.0",
      "requirements": [
        "chargeamps==1.5.1",
        "homeassistant>=2021.9.0"
      ]
    },
    "gardena_smart_system": {
      "version": "1.0.0",
      "requirements": [
        "py-smart-gardena==1.3.6"
      ]
    },
    "iphonedetect": {
      "version": "1.4.0",
      "requirements": []
    },
    "xiaomi_cloud_map_extractor": {
      "version": "v2.2.0",
      "requirements": [
        "pillow",
        "pybase64",
        "python-miio",
        "requests",
        "pycryptodome"
      ]
    },
    "brandriskute": {
      "version": "v1.1.3",
      "requirements": []
    },
    "tesla_custom": {
      "version": "3.3.1",
      "requirements": [
        "teslajsonpy==3.2.2"
      ]
    },
    "hacs": {
      "version": "1.28.4",
      "requirements": [
        "aiogithubapi>=22.2.4"
      ]
    },
    "better_thermostat": {
      "version": "1.0.0-beta47",
      "requirements": []
    },
    "dwains_dashboard": {
      "version": "2.0.3",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "better_thermostat",
    "name": "Better Thermostat",
    "documentation": "https://github.com/KartoffelToby/better_thermostat",
    "issue_tracker": "https://github.com/KartoffelToby/better_thermostat/issues",
    "iot_class": "local_push",
    "version": "1.0.0-beta47",
    "config_flow": true,
    "dependencies": [
      "climate",
      "recorder"
    ],
    "after_dependencies": [
      "climate"
    ],
    "codeowners": [
      "@kartoffeltoby",
      "@RubenKelevra"
    ],
    "requirements": [],
    "is_built_in": false
  },
  "data": {
    "info": {
      "name": "kontor",
      "temperature_sensor": "sensor.vardagsrum",
      "off_temperature": 20,
      "window_sensors": null,
      "humidity_sensor": null,
      "outdoor_sensor": null,
      "weather": null,
      "model": "010101"
    },
    "thermostat": {
      "climate.termostat_kontor_9": {
        "name": "Termostat kontor",
        "state": "heat",
        "attributes": {
          "hvac_modes": [
            "heat"
          ],
          "min_temp": 7,
          "max_temp": 35,
          "current_temperature": 21.3,
          "temperature": 22.5,
          "friendly_name": "Termostat kontor",
          "supported_features": 1
        },
        "bt_config": {
          "calibration": "target_temp_based",
          "heat_auto_swapped": false,
          "fix_calibration": false,
          "calibration_round": true,
          "child_lock": false,
          "homaticip": false
        },
        "bt_adapter": "zwave_js",
        "bt_integration": "zwave_js",
        "model": "010101"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.vardagsrum",
      "state": "19.9",
      "attributes": {
        "state_class": "measurement",
        "on": true,
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "Vardagsrum"
      },
      "last_changed": "2022-11-29T07:47:21.619522+00:00",
      "last_updated": "2022-11-29T07:47:21.619522+00:00",
      "context": {
        "id": "01GK15NKCKW95EZP5DB1TM5D27",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": "-"
  }

}

Description

Added the thermostate in better thermostate gui and everything looks good until I go and look at the control, there it say that the better themostate control is unavaliable.

Steps to Reproduce

  1. created the better thermostate via the GUI
  2. klick on the better thermostate device that I created
  3. In thee controls the thermostate is unavailable

Going directly to the popp device via z-wave js it seems to work just fine.

Versions

latest versions on everything

Additional Information

Found these stuff in the logfiles


Logger: custom_components.better_thermostat.utils.bridge Source: custom_components/better_thermostat/utils/bridge.py:31 Integration: Better Thermostat (documentation, issues) First occurred: 28 November 2022 at 08:25:19 (13 occurrences) Last logged: 10:48:06

better_thermostat vardagsrum 2: intigration: zwave_js isn't native supported, feel free to open an issue, fallback adapter generic better_thermostat : intigration: zwave_js isn't native supported, feel free to open an issue, fallback adapter generic better_thermostat vardagsrum: intigration: zwave_js isn't native supported, feel free to open an issue, fallback adapter generic better_thermostat kontor: intigration: zwave_js isn't native supported, feel free to open an issue, fallback adapter generic better_thermostat -: intigration: zwave_js isn't native supported, feel free to open an issue, fallback adapter generic

Logger: custom_components.better_thermostat.climate Source: custom_components/better_thermostat/climate.py:570 Integration: Better Thermostat (documentation, issues) First occurred: 28 November 2022 at 08:25:54 (5 occurrences) Last logged: 10:48:06

better_thermostat Vardagsrum: No previously hvac mode found on startup, turn heat off better_thermostat vardagsrum 2: No previously hvac mode found on startup, turn heat off better_thermostat vardagsrum: No previously hvac mode found on startup, turn heat off better_thermostat kontor: No previously hvac mode found on startup, turn heat off

Logger: homeassistant Source: components/zwave_js/climate.py:475 First occurred: 28 November 2022 at 08:25:54 (5 occurrences) Last logged: 10:48:06

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/better_thermostat/climate.py", line 657, in startup await control_trv(self, trv) File "/config/custom_components/better_thermostat/utils/controlling.py", line 153, in control_trv await set_hvac_mode(self, heater_entity_id, _hvac_mode_send) File "/config/custom_components/better_thermostat/utils/bridge.py", line 74, in set_hvac_mode return await self.real_trvs[entity_id]["adapter"].set_hvac_mode( File "/config/custom_components/better_thermostat/adapters/generic.py", line 39, in set_hvac_mode await self.hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/zwave_js/climate.py", line 475, in async_set_hvac_mode raise ValueError(f"Received an invalid hvac mode: {hvac_mode}") ValueError: Received an invalid hvac mode: off

samuelbagforsprivat commented 1 year ago

added the debug json

samuelbagforsprivat commented 1 year ago

added more logitems I found in the HA core logs

samuelbagforsprivat commented 1 year ago

same problem in beta49

ismileatyou commented 1 year ago

Hi, I have a simmilar trv (Danfoss lc-13). Issue is that our TRV has only one hvac_modes : heat

"thermostat": { "climate.living_connect_z_thermostat_heating": { "name": "Radiator Office", "state": "heat", "attributes": { "hvac_modes": [ "heat" ], "min_temp": 4, "max_temp": 28, "current_temperature": null, "temperature": 17.9, "friendly_name": "Radiator Office", "supported_features": 1 }

So when it is called to set it to: "off" it just fails, and does not start. And here: https://github.com/KartoffelToby/better_thermostat/blob/5abcdec2d8a10414d449398162a46b50164555be/custom_components/better_thermostat/climate.py#L569 it is trying to set it to "off".

I managed to "workaround" this by going to developer tools and seting state to: heat for BT thermostats.

KartoffelToby commented 1 year ago

Beta 51, shoud use the set temp to min, if off, if no off mode is there, also there is an option too to force it.