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
830 stars 126 forks source link

Unavailable devices for Devolo Conect on HA #1127

Open johnqa opened 1 year ago

johnqa commented 1 year ago

Prerequisites

{
  {
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.11.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.6",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Amsterdam",
    "os_name": "Linux",
    "os_version": "6.1.59",
    "supervisor": "2023.10.1",
    "host_os": "Home Assistant OS 11.1",
    "docker_version": "24.0.6",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "mitsubishi_wf_rac": {
      "version": "0.0.1",
      "requirements": [
        "aenum>=3.1.11"
      ]
    },
    "hacs": {
      "version": "1.33.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "nest_protect": {
      "version": "0.4.0b1",
      "requirements": []
    },
    "better_thermostat": {
      "version": "1.4.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "better_thermostat",
    "name": "Better Thermostat",
    "after_dependencies": [
      "climate"
    ],
    "codeowners": [
      "@kartoffeltoby"
    ],
    "config_flow": true,
    "dependencies": [
      "climate",
      "recorder"
    ],
    "documentation": "https://github.com/KartoffelToby/better_thermostat",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/KartoffelToby/better_thermostat/issues",
    "requirements": [],
    "version": "1.4.0",
    "is_built_in": false
  },
  "data": {
    "info": {
      "name": "Devolo_BetterThermostat",
      "temperature_sensor": "sensor.acuritev2_0ea8_temp",
      "off_temperature": 20,
      "tolerance": 1.0,
      "humidity_sensor": "sensor.acuritev2_0ea8_hum",
      "outdoor_sensor": "sensor.airco_ec0baeb929e0_outdoor",
      "window_sensors": null,
      "weather": null,
      "cooler": null,
      "window_off_delay": 0,
      "window_off_delay_after": 0,
      "model": "Devolo Connect"
    },
    "thermostat": {
      "climate.devoloradiator": {
        "name": "devoloradiator",
        "state": "heat",
        "attributes": {
          "hvac_modes": [
            "heat"
          ],
          "min_temp": 4,
          "max_temp": 28,
          "target_temp_step": 0.5,
          "current_temperature": null,
          "temperature": 23,
          "friendly_name": "devoloradiator",
          "supported_features": 1
        },
        "bt_config": {
          "calibration": "target_temp_based",
          "calibration_mode": "heating_power_calibration",
          "protect_overheating": true,
          "no_off_system_mode": true,
          "heat_auto_swapped": false,
          "child_lock": false,
          "homaticip": false
        },
        "bt_adapter": "devolo_home_control",
        "bt_integration": "devolo_home_control",
        "model": "Devolo Connect"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.acuritev2_0ea8_temp",
      "state": "20.4",
      "attributes": {
        "state_class": "measurement",
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "acuritev2_Devolo_temp"
      },
      "last_changed": "2023-11-08T09:17:16.260760+00:00",
      "last_updated": "2023-11-08T09:17:16.260760+00:00",
      "context": {
        "id": "01HEQ3HFK4TM0613F6G92EKPAD",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": "-"
  }
}

Description

I have a bunch of Devolo Z-Wave radiators integrated in HA using Devolo Home Control integration, and although they worked fine last year I cannot make them work this year. I tried to remove and add them, remove Better Thermostat Integration, change settings, the result is always the same- Device Unavailable for the 2 z-wave TRVs that are controlled directly by Devolo hub.

I have to extra TRVs that are conected to a Devolo thermostat and that in turn is controlled by Better Thermostat with no issue.

I use BT 1.4.0 and HA 2023.11.1 but the issues started long time ago this year.

Additional Information

Debugging Logs:

2023-11-08 10:12:58.029 DEBUG (MainThread) [custom_components.better_thermostat.config_flow] Updated config: {'name': 'Devolo_BetterThermostat', 'thermostat': [{'trv': 'climate.devoloradiator', 'integration': 'devolo_home_control', 'model': 'Devolo Connect', 'adapter': None, 'advanced': {'calibration': 'target_temp_based', 'calibration_mode': 'heating_power_calibration', 'protect_overheating': True, 'no_off_system_mode': True, 'heat_auto_swapped': False, 'child_lock': False, 'homaticip': False}}], 'temperature_sensor': 'sensor.acuritev2_0ea8_temp', 'off_temperature': 20, 'tolerance': 1.0, 'humidity_sensor': 'sensor.acuritev2_0ea8_hum', 'outdoor_sensor': 'sensor.airco_ec0baeb929e0_outdoor', 'window_sensors': None, 'weather': None, 'cooler': None, 'window_off_delay': 0, 'window_off_delay_after': 0, 'model': 'Devolo Connect'}
2023-11-08 10:13:02.763 INFO (MainThread) [custom_components.better_thermostat.utils.bridge] better_thermostat Devolo_BetterThermostat: intigration: devolo_home_control isn't native supported, feel free to open an issue, fallback adapter generic
2023-11-08 10:13:02.768 INFO (MainThread) [custom_components.better_thermostat.climate] better_thermostat Devolo_BetterThermostat: Waiting for entity to be ready...
2023-11-08 10:13:02.781 INFO (MainThread) [custom_components.better_thermostat.climate] better_thermostat Devolo_BetterThermostat: Starting version 1.4.0. Waiting for entity to be ready...
2023-11-08 10:13:02.782 DEBUG (MainThread) [custom_components.better_thermostat.climate] better_thermostat Devolo_BetterThermostat: Undefined target temperature, falling back to 23
2023-11-08 10:13:02.782 DEBUG (MainThread) [custom_components.better_thermostat.climate] better_thermostat Devolo_BetterThermostat: No previously hvac mode found on startup, turn bt to trv mode heat
2023-11-08 10:13:02.782 DEBUG (MainThread) [custom_components.better_thermostat.climate] better_thermostat Devolo_BetterThermostat: Startup config, BT hvac mode is heat, Target temp 23
2023-11-08 10:13:02.784 DEBUG (MainThread) [custom_components.better_thermostat.utils.controlling] better_thermostat Devolo_BetterThermostat: TO TRV set_temperature: climate.devoloradiator from: 23.0 to: None
2023-11-08 10:13:02.805 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/better_thermostat/climate.py", line 833, in startup
await control_trv(self, trv)
File "/config/custom_components/better_thermostat/utils/controlling.py", line 268, in control_trv
await set_temperature(self, heater_entity_id, _temperature)
File "/config/custom_components/better_thermostat/utils/bridge.py", line 77, in set_temperature
return await self.real_trvs[entity_id]["adapter"].set_temperature(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/better_thermostat/adapters/generic.py", line 111, in set_temperature
await self.hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 2001, in async_call
processed_data: dict[str, Any] = handler.schema(service_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 232, in __call__
return self._exec((Schema(val) for val in self.validators), v)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 355, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 351, in _exec
v = func(v)
^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
return schema(data)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 229, in _run
return self._exec(self._compiled, value, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 355, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 353, in _exec
v = func(path, v)
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
return schema(data)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
return base_validate(path, iteritems(data), out)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected float for dictionary value @ data['temperature']

Please have a look and let me know what am I doing wrong.

Thank you, John

TokoTSP commented 12 months ago

I have similar issue. I sucessully confured 8 better thermostat. One of them controls two real, all other controls single. All of the better themrostat are confugured to use external themperature and humidity sensors, all share the same outdoor soensor and wether service. When I tried to configure 9-th thermostat in exactly the same way (single real), it become "Unavailable" All real thermostats are identical Zigbee2MQTT and works without any problems by themselves.

enjikaka commented 11 months ago

Also seeing this with Bosch Sensor for IVT Geo 508.

2023-11-21 22:04:02.675 DEBUG (MainThread) [custom_components.better_thermostat.climate] better_thermostat Bättre Termostat: No previously hvac mode found on startup, turn bt to trv mode heat
2023-11-21 22:04:02.675 DEBUG (MainThread) [custom_components.better_thermostat.climate] better_thermostat Bättre Termostat: Startup config, BT hvac mode is heat, Target temp 19.0
2023-11-21 22:04:02.676 DEBUG (MainThread) [custom_components.better_thermostat.utils.controlling] better_thermostat Bättre Termostat: TO TRV set_temperature: climate.hc1_2 from: 19.0 to: None
2023-11-21 22:04:02.676 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/better_thermostat/climate.py", line 833, in startup
    await control_trv(self, trv)
  File "/config/custom_components/better_thermostat/utils/controlling.py", line 268, in control_trv
    await set_temperature(self, heater_entity_id, _temperature)
  File "/config/custom_components/better_thermostat/utils/bridge.py", line 77, in set_temperature
    return await self.real_trvs[entity_id]["adapter"].set_temperature(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/better_thermostat/adapters/generic.py", line 111, in set_temperature
    await self.hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2001, in async_call
    processed_data: dict[str, Any] = handler.schema(service_data)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 232, in __call__
    return self._exec((Schema(val) for val in self.validators), v)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 355, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 351, in _exec
    v = func(v)
        ^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 229, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 355, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 353, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
    return base_validate(path, iteritems(data), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected float for dictionary value @ data['temperature']

2023-11-21 22:04:02.676 DEBUG (MainThread) [custom_components.better_thermostat.utils.controlling] better_thermostat Bättre Termostat: TO TRV set_temperature: climate.hc1_2 from: 19.0 to: None

Setting temp to None seems to be the issue.