better_thermostat icon indicating copy to clipboard operation
better_thermostat copied to clipboard

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

Open bsafh opened this issue 1 year ago • 2 comments

Prerequisites

  • [ ] Danfoss Ally via ZHA
  • [ ] Output from Home Assistant Developer Tools state e.g.
  • [ ] Output from Home Assistant Device Diagnostic from BT
[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

  • Two identical TRV in one room.
  • Both real TRV are available in HA.
  • all sensors used are available in HA

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

  • reconfiguring the BT instance does not help
  • deleting the BT instance for the unavailable BT instance and re-installing does not help
  • creating a new BT instance with a different name does not help
  • restarting HA does not help
  • restarting the whole server does not help

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:

  • reboot
  • shutdown
  • services
  • network
  • hostname
  • timedate
  • os_agent
  • resolved
  • journal
  • disk
  • mount hassos: null homeassistant: 2023.10.5 hostname: homeassistant logging: info machine: qemux86-64 operating_system: Debian GNU/Linux 12 (bookworm) state: freeze supervisor: 2023.10.1 supported: true supported_arch:
  • amd64
  • i386 timezone: Europe/Berlin root@homeassistant:~#

BT 1.3.0

Additional Information

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

bsafh avatar Oct 30 '23 19:10 bsafh

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!

LinuxfarmerHH avatar Nov 04 '23 14:11 LinuxfarmerHH

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

doweis avatar Dec 02 '23 23:12 doweis