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
717 stars 124 forks source link

Heating won't start until kickstart from Z2M #1138

Open oleksii-kalinin opened 8 months ago

oleksii-kalinin commented 8 months ago

Prerequisites

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.11.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.6",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Warsaw",
    "os_name": "Linux",
    "os_version": "6.1.59",
    "supervisor": "2023.11.0",
    "host_os": "Home Assistant OS 11.1",
    "docker_version": "24.0.6",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    ....
    "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": "Living room",
      "temperature_sensor": "sensor.climate_living_room_temperature",
      "off_temperature": 12,
      "humidity_sensor": "sensor.climate_living_room_humidity",
      "window_sensors": "binary_sensor.all_windows",
      "weather": "weather.forecast_home",
      "outdoor_sensor": null,
      "window_off_delay": 0,
      "model": "SEA801-Zigbee/SEA802-Zigbee",
      "tolerance": 0.1,
      "window_off_delay_after": 0
    },
    "thermostat": {
      "climate.trv_living_room": {
        "name": "TRV Living room",
        "state": "heat",
        "attributes": {
          "hvac_modes": [
            "off",
            "heat",
            "auto"
          ],
          "min_temp": 5.0,
          "max_temp": 30.0,
          "target_temp_step": 0.5,
          "current_temperature": 21.8,
          "temperature": 23.0,
          "anti_scaling": "ON",
          "away_mode": "OFF",
          "battery_low": false,
          "child_lock": "LOCK",
          "current_heating_setpoint": 23,
          "frost_detection": "ON",
          "heating": "OFF",
          "last_seen": "2023-11-13T14:15:13+01:00",
          "linkquality": 255,
          "local_temperature": 21.8,
          "local_temperature_calibration": 0,
          "system_mode": "heat",
          "window_detection": "ON",
          "friendly_name": "TRV Living room",
          "supported_features": 1
        },
        "bt_config": {
          "calibration": "local_calibration_based",
          "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": "SEA801-Zigbee/SEA802-Zigbee"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.climate_living_room_temperature",
      "state": "22.09",
      "attributes": {
        "state_class": "measurement",
        "battery": 93,
        "humidity": 49.81,
        "last_seen": "2023-11-13T14:16:55+01:00",
        "linkquality": 255,
        "temperature": 22.09,
        "voltage": 2900,
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "Climate Living room Temperature"
      },
      "last_changed": "2023-11-13T13:16:55.137487+00:00",
      "last_updated": "2023-11-13T13:16:55.218797+00:00",
      "context": {
        "id": "01HF4D7WHJ2BF6335V652X89MV",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": {
      "entity_id": "binary_sensor.all_windows",
      "state": "off",
      "attributes": {
        "entity_id": [
          "binary_sensor.window_kitchen_contact",
          "binary_sensor.window_living_room_contact",
          "binary_sensor.window_bedroom_contact"
        ],
        "friendly_name": "All Windows"
      },
      "last_changed": "2023-11-13T11:15:37.447505+00:00",
      "last_updated": "2023-11-13T11:15:37.447505+00:00",
      "context": {
        "id": "01HF469SAQ1SA4G878ESWR7AZG",
        "parent_id": null,
        "user_id": null
      }
    }
  }
}

Description

It's about 1.3 degrees below the heater target but BT won't enable heating. I need to manually set Local temperature calibration to -1 and then BT adjusts it independently.

Steps to Reproduce

Expected behavior:

Heating starts when the temperature lowers below the target

Actual behavior:

Versions

HA: 2023.11.2 BT: 1.4.0

Additional Information

oleksii-kalinin commented 7 months ago

And the heating won't stop as well. Temperature reported by external sensor: 23.3. State of BT on the screenshot. Expected to heat stops after 23 degrees are reached.

{
    "anti_scaling": "ON",
    "away_mode": "OFF",
    "battery_low": false,
    "child_lock": "LOCK",
    "current_heating_setpoint": 23,
    "frost_detection": "ON",
    "heating": "ON",
    "last_seen": "2023-11-25T14:00:42+01:00",
    "linkquality": 196,
    "local_temperature": 22.8,
    "local_temperature_calibration": -1,
    "preset_mode": "none",
    "system_mode": "heat",
    "window_detection": "ON"
}
2023-11-25 14:12:48.025 INFO (MainThread) [custom_components.better_thermostat.climate] better_thermostat Living Room: startup completed.
2023-11-25 14:13:41.108 DEBUG (MainThread) [custom_components.better_thermostat.events.trv] better_thermostat Living Room: TRV climate.trv_living_room update received
2023-11-25 14:13:41.116 DEBUG (MainThread) [custom_components.better_thermostat.events.trv] better_thermostat Living Room: TRV climate.trv_living_room sends new internal temperature from 22.8 to 23.4
2023-11-25 14:13:41.117 DEBUG (MainThread) [custom_components.better_thermostat.events.trv] better_thermostat Living Room: trigger_trv_change / _old_heating_setpoint: 23.0 - _new_heating_setpoint: 23.0 - _last_temperature: 23.0
flxtr commented 5 months ago

I have the same issue with a SAE802 and TV02.

Due to the hysteresis of these thermostats, they effectively stay closed, until local temp drops by something between 1 to 2 kelvin below set-point, so immediate calibration is needed, when BT set-point changes.

Example:

Set-points of BT and actual thermostat are in sync, but actual heating starts about an hour after the set-point change. (This is basically a fault by the actual thermostat. But for my understanding, BT want's to fix those issues.)

Actual thermostat: "Heizkörper Kinderzimmer" Better Thermostat with external temperature sensor: "BT Kindezimmer"

grafik

At 6:00 the set-point of BT where set to 20°C: grafik

At 8:26 the first calibration happens to the actual thermostat (apparent drop of local temp at actual termostat): grafik

I looked at the code, but I don't know much about HA programming and couldn't figure myself what triggers calibration and what has to be changed to make calibration happen on any set-point change.

The only thing that helps—like @oleksii-kalinin wrote—is to "kickstart" heating by manually setting the local calibration value of the actual thermostat to a negative value.