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
792 stars 123 forks source link

Current temperature not available from termostat #1413

Open bkosse opened 5 days ago

bkosse commented 5 days ago

Prerequisites

  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.10.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Amsterdam",
    "os_name": "Linux",
    "os_version": "6.6.31-haos-raspi",
    "supervisor": "2024.10.0",
    "host_os": "Home Assistant OS 13.1",
    "docker_version": "26.1.4",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "2.0.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "better_thermostat": {
      "documentation": "https://github.com/KartoffelToby/better_thermostat",
      "version": "1.6.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.6.0",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 6.752200000192943e-05
    },
    "01J9KHC5A8N61S057NQV1E44KH": {
      "wait_import_platforms": -1.015796770999998,
      "config_entry_setup": 1.0663679489999964
    },
    "01J9V7ZET6AD5SCPF14ACYPRW9": {
      "wait_import_platforms": -1.0663342630000017,
      "config_entry_setup": 1.067622215
    }
  },
  "data": {
    "info": {
      "name": "Test",
      "temperature_sensor": "number.convector_huiskamer_rechts_local_temperature_calibration",
      "off_temperature": 20,
      "tolerance": 0.0,
      "target_temp_step": 0.0,
      "window_sensors": null,
      "humidity_sensor": null,
      "outdoor_sensor": null,
      "weather": null,
      "cooler": null,
      "window_off_delay": 0,
      "window_off_delay_after": 0,
      "model": "TV02-Zigbee"
    },
    "thermostat": {
      "climate.convector_huiskamer_rechts": {
        "name": "Convector Huiskamer rechts",
        "state": "heat",
        "attributes": {
          "hvac_modes": [
            "off",
            "heat"
          ],
          "min_temp": 5.0,
          "max_temp": 30.0,
          "target_temp_step": 0.5,
          "preset_modes": [
            "none",
            "auto",
            "manual",
            "holiday"
          ],
          "current_temperature": 19.3,
          "temperature": 5.0,
          "preset_mode": "manual",
          "friendly_name": "Convector Huiskamer rechts",
          "supported_features": 401
        },
        "bt_config": {
          "calibration": "local_calibration_based",
          "calibration_mode": "no_calibration",
          "protect_overheating": false,
          "no_off_system_mode": false,
          "heat_auto_swapped": false,
          "child_lock": false,
          "homaticip": false
        },
        "bt_adapter": "mqtt",
        "bt_integration": "mqtt",
        "model": "TV02-Zigbee"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "number.convector_huiskamer_rechts_local_temperature_calibration",
      "state": "0",
      "attributes": {
        "min": -5.0,
        "max": 5.0,
        "step": 0.1,
        "mode": "auto",
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "icon": "mdi:math-compass",
        "friendly_name": "Convector Huiskamer rechts Temperature"
      },
      "last_changed": "2024-10-10T13:19:35.088012+00:00",
      "last_reported": "2024-10-10T13:19:35.088012+00:00",
      "last_updated": "2024-10-10T13:19:35.088012+00:00",
      "context": {
        "id": "01J9V9BCNGTZRE37BCM5MXE14W",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": "-"
  }
}

Description

When setting up Better Thermostat with three Tuya devices and one of the three is used as temperature sensor, the current temperature reports 0.

Steps to Reproduce

  1. Setup BT with Tuya thermostat devices A, B and C.
  2. Use thermostat A as the temperature sensor

Expected behavior: The current temperature reported by thermostat A is read correctly (external_temperature_sensor -> state)

Actual behavior: The current temperature reported by thermostat A is reads 0.

{
    "external_temperature_sensor": {
      "state": "0",
      }
}

Versions

HA: 2024.10.1 BT: 1.6.0

andy-vdg commented 5 days ago

I noticed this with mine as well. If you choose your own thermostat as a temperature sensor it does not take the local temperature - it takes the temperature offset instead. So it will show 0 or -1 or +2 or whatever the offset is set to. If you change the offset value in your thermostat, you should see it change in Better Thermostat. I solved it by just ordering more temperature sensors and using external ones - that's what it's meant for anyway as it isn't great measuring the rooms temp right next to it's heat source.