Renaming thermostat in zigbee2mqtt, changing the homeassistant id causes exception
phdoerfler opened this issue · 2 comments
Prerequisites
- Model name of your Devices:
- Eurotronic
- Spirit Zigbee wireless heater thermostat
- Zigbee model SPZB0001
- Firmware build date 20191014
- Firmware version 22190930
- Output from Home Assistant Developer Tools state (Output of the underlying real thermostat)
hvac_modes:
- "off"
- auto
- heat
min_temp: 5
max_temp: 30
target_temp_step: 0.5
current_temperature: 21
temperature: 21
hvac_action: heating
friendly_name: trv_kueche
supported_features: 385
- Output from Home Assistant Device Diagnostic from BT <- unable to include due to #1469
Description
In zigbee2mqtt rename device with the box "Update Home Assistant entity ID" checked, changing the entity ID from, e.g., "climate.trv_küche" to "climate.trv_kueche".
Steps to Reproduce
see description
Expected behavior:
I expect renaming to be handled more gracefully.
Actual behavior:
The log shows this exception multiple times:
2024-11-17 11:14:04.951 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/config/custom_components/better_thermostat/climate.py", line 794, in startup
await init(self, trv)
File "/config/custom_components/better_thermostat/adapters/delegate.py", line 46, in init
return await self.real_trvs[entity_id]["adapter"].init(self, entity_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/better_thermostat/adapters/mqtt.py", line 47, in init
).state in (STATE_UNAVAILABLE, STATE_UNKNOWN, None):
^^^^^
AttributeError: 'NoneType' object has no attribute 'state'
Versions
BT: 1.6.1
HA:
Core 2024.11.2
Supervisor 2024.11.2
Operating System 13.2
Frontend 20241106.2
Additional Information
No additional information
You are renaming the device inside home assistant.
Why should better Thermostat pick up the new name, if to this plugin it just looks like there is a new thermostat installed.
This behaviour is totally expected and not a bug.
I mean. Correct me if I'm wrong, but better Thermostat has no knowledge about changes within home assistant, so this is unfixable.
Just don't rename your thermostats or simply set up a new one within better Thermostat.