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

unable to recreate BT instances, HA ignores them, (no unique identifier) #1115

Open bsafh opened 1 year ago

bsafh commented 1 year ago

Prerequisites

[climate.trv_ai_schlafzimmer_1](http://localhost:8123/developer-tools/state#)
TRV_AI_Schlafzimmer_1
    unavailable     hvac_modes: heat, off
min_temp: 5
max_temp: 26
target_temp_step: 0.5
friendly_name: TRV_AI_Schlafzimmer_1
supported_features:
[climate.trv_ai_schlafzimmer_2](http://localhost:8123/developer-tools/state#)
TRV_AI_Schlafzimmer_2
    heat    hvac_modes: heat, off
min_temp: 5
max_temp: 24
target_temp_step: 0.5
current_temperature: 20.9
temperature: 20
hvac_action: idle
window_open: false
call_for_heat: true
last_change: 2023-10-30T16:19:13.990202
saved_temperature: null
humidity: 73.1
main_mode: heat
tolerance: 0.2
heating_power: 0.01
errors: []
batteries: {"sensor.temp_hum_schlafzimmer_5_humidity": {"battery": "99", "battery_id": "sensor.temp_hum_schlafzimmer_5_battery"}, "climate.trv_danfoss_schlafzimmer_fenster_thermostat": {"battery": "35", "battery_id": "sensor.trv_danfoss_schlafzimmer_fenster_battery"}}
friendly_name: TRV_AI_Schlafzimmer_2
supported_features: 1

config_entry-better_thermostat-19ff6ef24c23ea02bb77249529693c07.json.txt

config_entry-better_thermostat-05f8998637a9b08ab2cdc49410e99881.json.txt

HA log (with debug on)

Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:610
Integration: Klima (documentation, issues)
First occurred: 18:19:14 (3 occurrences)
Last logged: 18:40:39

Platform better_thermostat does not generate unique IDs. ID 05f8998637a9b08ab2cdc49410e99881 already exists - ignoring climate.trv_ai_schlafzimmer_2
Platform better_thermostat does not generate unique IDs. ID 08cc22895fded1ef4ff9e8e11780e4a2 already exists - ignoring climate.trv_ai_schlafzimmer_1_test
Platform better_thermostat does not generate unique IDs. ID 19ff6ef24c23ea02bb77249529693c07 already exists - ignoring climate.trv_ai_schlafzimmer_1
Logger: homeassistant.config_entries
Source: config_entries.py:399
First occurred: 18:05:57 (10 occurrences)
Last logged: 18:40:39

Error setting up entry TRV_AI_Schlafzimmer_2 for climate
Error setting up entry TRV_AI_Schlafzimmer_1 for climate
Error setting up entry TRV_AI_Schlafzimmer_1_test for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 195, in async_setup_entry
    return await component.async_setup_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 187, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

Logger: homeassistant.config_entries Source: config_entries.py:565 First occurred: 18:05:57 (23 occurrences) Last logged: 18:40:39

Error unloading entry TRV_AI_Schlafzimmer_2 for climate Error unloading entry TRV_AI_Schlafzimmer_1 for climate Error unloading entry TRV_AI_Schlafzimmer_1_test for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 565, in async_unload result = await component.async_unload_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 201, in async_unload_entry return await component.async_unload_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry raise ValueError("Config entry was never loaded!") ValueError: Config entry was never loaded!

Description

one of the two BT instances is available, the other is permanently not available ("Schlafzimmer 1")

Steps to Reproduce

start HA and wait.

the BT TRV does never come up

Expected behavior:

both BT TRV working

Actual behavior:

one of the TRV is permanently unavailabe

Versions

HA root@homeassistant:~# ha info arch: amd64 channel: stable docker: 24.0.7 features:

BT 1.3.0

Additional Information

well, if anyone knows where to dig for more info, I#ll do it

LinuxfarmerHH commented 1 year ago

1.4.0 found something that seems to belong to my Issue 1116

Here this BT instance hang in the waitstate as described in issue 1116, i tried to reconfigure it with no result. This is the debug log, it's not possible to reconfigure because the old instance is hanging in waitstate for a device. It is the same unique ID, but the old instance did not stop. As described in Issue 1116 a hanging instance from waiting for device does this for several hours here.

ValueError: Config entry has already been setup! 2023-11-04 15:11:51.211 ERROR (MainThread) [homeassistant.components.climate] Platform better_thermostat does not generate unique IDs. ID 8f38f2dd2a0ad9a781186561fe5c30fa already exists - ignoring climate.hzg_stube 2023-11-04 15:12:08.491 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities climate.hzg_stube are missing or not currently available 2023-11-04 15:20:10.994 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending! 2023-11-04 15:20:10.995 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending! 2023-11-04 15:20:11.008 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending! 2023-11-04 15:20:11.008 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!

doweis commented 11 months ago

Same error her, had to delete the 'home-assistant_v2.db' file and then recreate the Better Thermostat entry to resolve the issue.