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
874 stars 130 forks source link

TRV does not close when target temp is reached #1421

Open Schlicki opened 1 month ago

Schlicki commented 1 month ago

Prerequisites

{
  `{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.10.3",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "6.6.54-haos",
    "supervisor": "2024.10.2",
    "host_os": "Home Assistant OS 13.2",
    "docker_version": "27.2.0",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "spook_inverse": {
      "documentation": "https://spook.boo",
      "version": "3.1.0",
      "requirements": []
    },
    "govee": {
      "documentation": "https://github.com/LaggAt/hacs-govee/blob/master/README.md",
      "version": "2023.11.1",
      "requirements": [
        "govee-api-laggat==0.2.2",
        "dacite==1.8.0"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "2.0.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "localtuya": {
      "documentation": "https://github.com/rospogrigio/localtuya/",
      "version": "5.2.1",
      "requirements": []
    },
    "openmediavault": {
      "documentation": "https://github.com/tomaae/homeassistant-openmediavault",
      "version": "0.0.0",
      "requirements": []
    },
    "growatt_server_api": {
      "documentation": "https://github.com/muppet3000/homeassistant-growatt_server_api",
      "version": "1.0.4",
      "requirements": [
        "growattServer==1.3.0"
      ]
    },
    "spook": {
      "documentation": "https://spook.boo",
      "version": "3.1.0",
      "requirements": []
    },
    "tapo": {
      "documentation": "https://github.com/petretiandrea/home-assistant-tapo-p100",
      "version": "3.1.2",
      "requirements": [
        "plugp100==5.1.3"
      ]
    },
    "better_thermostat": {
      "documentation": "https://github.com/KartoffelToby/better_thermostat",
      "version": "1.6.0",
      "requirements": []
    },
    "watchman": {
      "documentation": "https://github.com/dummylabs/thewatchman",
      "version": "0.6.3",
      "requirements": [
        "prettytable==3.10.0"
      ]
    }
  },
  "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.6.0",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 0.0001056909968610853
    },
    "4f72f04c3007e58822c95c6c42eac09d": {
      "wait_import_platforms": -6.741651299002115,
      "config_entry_setup": 6.888682582997717
    },
    "62777ba1e5b532df2a029a844d2a2041": {
      "wait_import_platforms": -6.888689882995095,
      "config_entry_setup": 6.898487158992793
    },
    "3e0d19cd06d2d05deb71dffc2f00e292": {
      "wait_import_platforms": -6.898469799984014,
      "config_entry_setup": 6.908984149020398
    }
  },
  "data": {
    "info": {
      "name": "Kinderzimmer",
      "temperature_sensor": "sensor.kinderzimmer_sensor_temperatur",
      "off_temperature": 20,
      "tolerance": 0.0,
      "target_temp_step": 0.0,
      "window_sensors": "binary_sensor.fenstersensor_kinderzimmer_contact",
      "humidity_sensor": "sensor.kinderzimmer_sensor_luftfeuchtigkeit",
      "outdoor_sensor": null,
      "weather": "weather.home",
      "cooler": null,
      "window_off_delay": 60,
      "window_off_delay_after": 300,
      "model": "ME167"
    },
    "thermostat": {
      "climate.heizung_kinderzimmer": {
        "name": "Heizung Kinderzimmer",
        "state": "off",
        "attributes": {
          "hvac_modes": [
            "auto",
            "heat",
            "off"
          ],
          "min_temp": 5.0,
          "max_temp": 35.0,
          "target_temp_step": 1.0,
          "current_temperature": 18.0,
          "temperature": 5.0,
          "hvac_action": "idle",
          "icon": "mdi:teddy-bear",
          "friendly_name": "Heizung Kinderzimmer",
          "supported_features": 385
        },
        "bt_config": {
          "calibration": "hybrid_calibration",
          "calibration_mode": "default",
          "protect_overheating": false,
          "no_off_system_mode": false,
          "heat_auto_swapped": false,
          "child_lock": false,
          "homaticip": false
        },
        "bt_adapter": "mqtt",
        "bt_integration": "mqtt",
        "model": "ME167"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.kinderzimmer_sensor_temperatur",
      "state": "24.9",
      "attributes": {
        "state_class": "measurement",
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "Kinderzimmer Sensor Temperatur"
      },
      "last_changed": "2024-10-22T09:04:07.568912+00:00",
      "last_reported": "2024-10-22T09:04:07.568912+00:00",
      "last_updated": "2024-10-22T09:04:07.568912+00:00",
      "context": {
        "id": "01JASQG8CGWG3FKAWBCWAS5GME",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": {
      "entity_id": "binary_sensor.fenstersensor_kinderzimmer_contact",
      "state": "off",
      "attributes": {
        "device_class": "window",
        "icon": "mdi:window-closed-variant",
        "friendly_name": "Fenstersensor Kinderzimmer T\u00fcr"
      },
      "last_changed": "2024-10-22T08:40:30.084032+00:00",
      "last_reported": "2024-10-22T08:40:30.084032+00:00",
      "last_updated": "2024-10-22T08:40:30.084032+00:00",
      "context": {
        "id": "01JASP5044M5WGC223DJ4C8A6D",
        "parent_id": null,
        "user_id": null
      }
    }
  }
}`
}

Description

BT is linked with TRV and sensors for temperature and window state. Although the target temp is reached, the TRV gets not closed but continues heating. The TRV temp gets reduced but seems not to close. Tried different calibrations with no effort.

Expected behavior:

Closing the TRV correctly

Actual behavior:

TRV keeps on heating

Schlicki commented 1 month ago

Same problem in other room with same setup too.

amadeo-alex commented 3 weeks ago

I have a similar/same device https://www.zigbee2mqtt.io/devices/TRV06_1.html The hysteresis on those devices seems to be hard coded to 1 - so setting of 22 would "heat" until 23 is reached.

As it happens I've observed just do this on mine, the BT showed no heating but the TRV "closed" (because it closed only partially of course) only after it reached and maintained 23 for some time. Can it be the case with yours also?

RubenKelevra commented 1 week ago

The solution would be to adjust Better Thermostat to read the valve opening percentage off the thermostat and turn the thermostat off and on again, if it's above a certain threshold -0.5°C below the set point is reached in the room.

This works fine for the TS0601_thermostat, which has the same issue.

I've created an automation a long time ago for this, which does exactly this and fixes the issue:

Screenshot_20241115_180224

Panoramiac commented 1 week ago

I read recently that the most trv does not provide the valve percentage, I do not see them for my Rollei TRVs for example. Screenshot_20241115_192748_Home Assistant

RubenKelevra commented 1 week ago

@Panoramiac I've looked quickly through the z2m database. 19 support a valve position and 28 does not. However, this may not mean that they don't support it, but just that z2m not (yet) support reading those (not so important) debug values from the valve.

And models also do not equal deployed TRVs in the wild. Some models are extremely popular, while others are not.

But no valve position just means we got a binary value to work with: Which basically say 0% valve position or not, which you can see as "heating" or "idle" in the GUI.

If we heat up a room, and not just hold a temperature, the TRV should be stopped from flowing additional heat into the radiator at latest 0.5°C before the setpoint.

The reason for this is, that the external temperature probe is far away from the radiator and thus the temperature change takes time until the hot air reaches the external probe.

The TRV's logic however expects that the temperature is measured closely to the radiator which means it get a higher reading much more quickly. The algorithm in the TRV is tuned for different latency between heating and seeing an effect, which leads to this overshooting.

The more mass compared to the room size is involved, the worse the overshooting becomes. So large radiator in a small room or old cast iron radiators are particularly affected by this.

Panoramiac commented 1 week ago

LpThis would explain why two radiators where overshooting as they are in the smallest rooms. I discovered this two days ago close to midnight. The rooms should have cooled down (19° set) but but they where at 22°. Here some Screenshots: Screenshot_20241114_000141_Home Assistant

The offset was total over. I got it under control by using the target temperature setting.

Screenshot_20241114_001735_Home Assistant

I have also log files in case this is relevant. Back to the valve position. I would love to get this value added to my Rollei TRVs. I am using Zha, so it should be possible to add this by adjusting the quirk file, right? I have TS0601_TZE200_hue3yfsn (Sold by Rollei in Germany) with the ts0601_trv_zonnsmart.ZonnsmartTV01_ZG quirk file.