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

Temperature of real TRV stuck below BT target temp #935

Closed Soukyuu closed 1 year ago

Soukyuu commented 1 year ago

Prerequisites

Model of the device: SEA801-Zigbee/SEA802-Zigbee

image

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.1.7",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.7",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "5.15.80",
    "supervisor": "2023.01.1",
    "host_os": "Home Assistant OS 9.4",
    "docker_version": "20.10.19",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "dwd_weather": {
      "version": "1.2.24",
      "requirements": [
        "simple_dwd_weatherforecast==1.1.5",
        "markdownify==0.6.5"
      ]
    },
    "dwd_pollenflug": {
      "version": "1.0.1",
      "requirements": []
    },
    "better_thermostat": {
      "version": "1.0.0",
      "requirements": []
    },
    "localtuya": {
      "version": "5.0.0",
      "requirements": []
    },
    "qr_generator": {
      "version": "1.0.2",
      "requirements": [
        "pyqrcode==1.2.1",
        "pypng==0.0.21",
        "pillow==9.3.0"
      ]
    },
    "adaptive_lighting": {
      "version": "1.4.1",
      "requirements": []
    },
    "climate_group": {
      "version": "0.4.2",
      "requirements": []
    },
    "hacs": {
      "version": "1.30.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    }
  },
  "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",
    "config_flow": true,
    "dependencies": [
      "climate",
      "recorder"
    ],
    "after_dependencies": [
      "climate"
    ],
    "codeowners": [
      "@kartoffeltoby"
    ],
    "requirements": [],
    "is_built_in": false
  },
  "data": {
    "info": {
      "name": "Toilette AI Thermostat",
      "temperature_sensor": "sensor.toilette_raumklima_temperature",
      "off_temperature": 20,
      "humidity_sensor": "sensor.toilette_raumklima_humidity",
      "window_sensors": "binary_sensor.toilette_fenster_contact",
      "weather": "weather.dwd_weather_schwaeb_gmuend_1h",
      "outdoor_sensor": null,
      "model": "SEA801-Zigbee/SEA802-Zigbee",
      "window_off_delay": 0
    },
    "thermostat": {
      "climate.toilette_thermostat": {
        "name": "Toilette Thermostat",
        "state": "heat",
        "attributes": {
          "hvac_modes": [
            "off",
            "heat",
            "auto"
          ],
          "min_temp": 5.0,
          "max_temp": 30.0,
          "target_temp_step": 0.5,
          "current_temperature": 16.1,
          "temperature": 16.0,
          "anti_scaling": "ON",
          "away_mode": "OFF",
          "battery_low": false,
          "child_lock": "LOCK",
          "current_heating_setpoint": 16,
          "device": {
            "applicationVersion": 85,
            "dateCode": "",
            "friendlyName": "toilette_thermostat",
            "hardwareVersion": 1,
            "ieeeAddr": "0xcc86ecfffea0fccd",
            "manufacturerID": 4098,
            "manufacturerName": "_TZE200_yw7cahqs",
            "model": "SEA801-Zigbee/SEA802-Zigbee",
            "networkAddress": 19069,
            "powerSource": "Battery",
            "stackVersion": 0,
            "type": "EndDevice",
            "zclVersion": 3
          },
          "frost_detection": "ON",
          "heating": null,
          "linkquality": 255,
          "local_temperature": 16.1,
          "local_temperature_calibration": 0,
          "system_mode": "heat",
          "window_detection": "ON",
          "friendly_name": "Toilette Thermostat",
          "supported_features": 1
        },
        "bt_config": {
          "calibration": "target_temp_based",
          "calibration_mode": "heating_power_calibration",
          "calibration_round": true,
          "no_off_system_mode": false,
          "heat_auto_swapped": false,
          "child_lock": true,
          "homaticip": false
        },
        "bt_adapter": "mqtt",
        "bt_integration": "mqtt",
        "model": "SEA801-Zigbee/SEA802-Zigbee"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.toilette_raumklima_temperature",
      "state": "15.79",
      "attributes": {
        "state_class": "measurement",
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "Toilette Raumklima Temperature"
      },
      "last_changed": "2023-02-02T09:11:36.317158+00:00",
      "last_updated": "2023-02-02T09:11:36.317158+00:00",
      "context": {
        "id": "01GR8PAJKXSZ6752WYG6XGVFR5",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": {
      "entity_id": "binary_sensor.toilette_fenster_contact",
      "state": "off",
      "attributes": {
        "battery": 45,
        "battery_low": false,
        "contact": true,
        "device": {
          "applicationVersion": 69,
          "dateCode": "",
          "friendlyName": "toilette_fenster",
          "hardwareVersion": 1,
          "ieeeAddr": "0xa4c138d1013f0c71",
          "manufacturerID": 4417,
          "manufacturerName": "_TZ3000_26fmupbb",
          "model": "TS0203",
          "networkAddress": 21791,
          "powerSource": "Battery",
          "stackVersion": 0,
          "type": "EndDevice",
          "zclVersion": 3
        },
        "linkquality": 255,
        "tamper": false,
        "voltage": 2700,
        "device_class": "door",
        "friendly_name": "toilette_fenster_contact"
      },
      "last_changed": "2023-02-01T07:20:10.300216+00:00",
      "last_updated": "2023-02-01T07:20:10.300216+00:00",
      "context": {
        "id": "01GR5XHT9WAZV6VCYBN4E1AQE5",
        "parent_id": null,
        "user_id": null
      }
    }
  }
}

Description

I have an automation that sets the night mode temperature to 18°C from 22:00 to 6:30. Occasionally the temperature gets stuck at the night temperature according to the TRV (16°C). the BT entry shows the correct daytime temperature (20°C) and no matter what I do on the BT side, the tempertature on the real TRV does not change. I attempted to activate diagnostic logs but can't find any better_thermostat entries beyond the message that the component has been loaded. Reloading the integration does nothing.

Steps to Reproduce

  1. Create an automation using the night mode blueprint
  2. Monitor the temperature the next day

Expected behavior:

The temperature being restored and TRV heating the room

Actual behavior:

Sometimes the BT entity seems to be stuck at night temperature despite GUI showing day temperature

Versions

HA 2023.1.7, BT 1.0.0

Additional Information

The only way to get it working again is to recreate the BT integration instance. Does not seem to work, still stuck at 16°C despite re-creating.

Here are the real and BT TRV entities and their history for the past 24h: image image image

Soukyuu commented 1 year ago

I got it "unstuck" by switching to Offset-based calibration, then back to Temperature-based.

isibizi commented 1 year ago

I have the same problem.

dundiffrunt commented 1 year ago

Same here.

wtom commented 1 year ago

What is the heating_power value if you check on the developer_tools / states?

dundiffrunt commented 1 year ago

The values are different on all TRVs. Here are the values:

climate.wohnzimmer (faulty): 0.01 climate.kueche (faulty): 0.0098 climate.badezimmer (faulty): 0.0052

climate.flur (works): 0.0047 climate.buro (works): 0.0087

wtom commented 1 year ago

Okay, they look fine. Then we need some debug logs, otherwise it's hard to guess what's happening.

dundiffrunt commented 1 year ago

No problem. What type of logs do you need? How would I produce a log which contains only the necessary information?

dundiffrunt commented 1 year ago

Update: Tested activating night mode at 14:00 and the logs show this: 2023-02-08 14:00:00.946 ERROR (MainThread) [homeassistant.components.mqtt.climate] Invalid modes mode: auto

I'm confused. This is the integrations's config: grafik

Beginner88888 commented 1 year ago

i have the same issue. I think it is because the TRV has no Auto mode ... my log shows me following message for all of my TRV:

TS0601 von _TZE200_hue3yfsn

2023-02-11 11:41:45.208 WARNING (MainThread) [homeassistant.components.zha.entity] climate.thermostat_badezimmer_zonnsmartthermostat: can't set 'auto' mode. Supported modes are: [<HVACMode.OFF: 'off'>, <HVACMode.HEAT: 'heat'>]

maybe the source code or something else must be adjusted to the specific mode of this TRV, that only hast OFF and HEAT and no AUTO mode

KartoffelToby commented 1 year ago

Think this is related to the main issues with TS0601, pls search for TS0601 in the issues

Soukyuu commented 1 year ago

I'm not sure which issues you mean, but it seems that it's BT having a problem reading the local_temperature_offset of some thermostats. It displays fine in HA and zigbee2mqtt, but in bt logs it complains about a float value for int.

It only breaks when using the night time template or rather the set target temp service.

I now have a workaround automation which sets all local_temperature_offsets to 0 after night time schedule ends and so far, no more stuck thermostats.

eivissacopter commented 8 months ago

I am still struggling with this issue. My Netatmo Thermostats often stay stuck at 7°C (off setting) after the night ends or when I return to the house. Both automations trigger the comfort temperature, but not every Netatmo thermostat reacts and switches to heating. The BT command works without issues.

With the Netatmo Thermostats the only option is "Target Temperature Based" not offset.

I have already tried a secondary automation that just activates heating mode or higher temperature on the Netatmo thermostats and then lets BT do the rest, but this doesnt seem to solve the issue.

Any idea what Automation I could use to unfreeze/activate the Thermostats so BT can engage heating everytime and not in like 60% of all occasions?