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
751 stars 122 forks source link

BT device unavailable after creating it or rebooting HA #1336

Open tco99ttocs opened 4 months ago

tco99ttocs commented 4 months ago

Prerequisites

state of the BT device:

hvac_modes:

state of the trv801w:

hvac_modes:

{
   "home_assistant": {
    "installation_type": "Home Assistant Supervised",
    "version": "2024.4.3",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.2",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "6.1.0-0.deb11.11-amd64",
    "supervisor": "2024.04.0",
    "host_os": "Debian GNU/Linux 11 (bullseye)",
    "docker_version": "26.0.1",
    "chassis": "desktop",
    "run_as_root": true
  },
  "custom_components": {
    "better_thermostat": {
      "version": "1.5.0",
      "requirements": []
    },
    "scheduler": {
      "version": "v0.0.0",
      "requirements": []
    },
    "hacs": {
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "dwd": {
      "version": "2024.1.0",
      "requirements": [
        "defusedxml==0.7.1"
      ]
    },
    "ui_lovelace_minimalist": {
      "version": "v1.3.9",
      "requirements": [
        "aiofiles==0.8.0",
        "aiogithubapi>=22.2.4"
      ]
    },
    "openmediavault": {
      "version": "0.0.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.5.0",
    "is_built_in": false
  },
  "data": {
    "info": {
      "name": "test",
      "temperature_sensor": "sensor.t_h_sensor_wz_temperatur",
      "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": "1q1grefcvygxzc7w"
    },
    "thermostat": {
      "climate.wifi_smart_thermostat": {
        "name": "WiFi Thermostat WZ",
        "state": "heat_cool",
        "attributes": {
          "hvac_modes": [
            "off",
            "heat_cool",
            "heat_cool"
          ],
          "min_temp": 5.0,
          "max_temp": 35.0,
          "target_temp_step": 0.5,
          "current_temperature": 21.9,
          "temperature": 23.0,
          "friendly_name": "WiFi Thermostat WZ",
          "supported_features": 1
        },
        "bt_config": {
          "calibration": "target_temp_based",
          "calibration_mode": "heating_power_calibration",
          "protect_overheating": false,
          "no_off_system_mode": true,
          "heat_auto_swapped": false,
          "child_lock": false,
          "homaticip": false
        },
        "bt_adapter": "tuya",
        "bt_integration": "tuya",
        "model": "1q1grefcvygxzc7w"
      }
    },
    "external_temperature_sensor": {
      "entity_id": "sensor.t_h_sensor_wz_temperatur",
      "state": "20.6",
      "attributes": {
        "state_class": "measurement",
        "unit_of_measurement": "\u00b0C",
        "device_class": "temperature",
        "friendly_name": "T & H Sensor WZ Temperatur"
      },
      "last_changed": "2024-04-17T05:28:46.255623+00:00",
      "last_reported": "2024-04-17T06:24:35.456737+00:00",
      "last_updated": "2024-04-17T05:28:46.255623+00:00",
      "context": {
        "id": "01HVN8ESXFS743MM3KR68M0RHT",
        "parent_id": null,
        "user_id": null
      }
    },
    "window_sensor": "-"
  }
}

Description

after creating a BT with the TRV 801w, the new BT device is unavailable. If i do the configuration again, equal if i change something or not, the bt device is getting available. Until the HA has to be rebooted. After the reboot the bt device is unavailable forever. So the configuration hack won't work. Th only think is to delete it and create it new!

Steps to Reproduce

  1. create BT device -> unavailable
  2. do the configuration again -> available
  3. reboot HA -> unavailable forever

Expected behavior:

BT device should be work from the beginning ;)

Actual behavior:

doesnt work from beginning

Versions

tested with 1.4.0, 1.5.0 - beta6, 1.5.0 - beta7 and 1.5.0

Additional Information

i tried some different TRV801w and some different external temperature sensor, always the same. The temperature sensors worked fine with some AVM 301, so the problem must be the TRV801w!

tco99ttocs commented 4 months ago

could be closed i think is the same like issue #1322