hristo-atanasov / Tasmota-IRHVAC

Home Assistant platform for controlling IR Air Conditioners via Tasmota IRHVAC command and compatible hardware
200 stars 67 forks source link

AttributeError: 'TasmotaIrhvac' object has no attribute '__attr_preset_mode'. Did you mean: '__attr_preset_modes'? #144

Closed andrewwong2000 closed 3 months ago

andrewwong2000 commented 3 months ago

Core. 2024.6.3 Supervisor. 2024.06.0 Operating System. 12.3 Frontend. 20240610.1

My Tasmota IR devices are all getting the error. Stack trace and YAML is below.

Thanks for any help to figure out why a working system now won't startup.

Climate.yaml


Stack Trace

Logger: homeassistant.components.climate Source: helpers/entity_platform.py:600 integration: Climate (documentation, issues) First occurred: 8:22:50 PM (3 occurrences) Last logged: 8:22:50 PM

Error adding entity climate.bedroom_ac for domain climate with platform tasmota_irhvac Error adding entity climate.study_ac for domain climate with platform tasmota_irhvac Error adding entity climate.kitchen_ac for domain climate with platform tasmota_irhvac Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 914, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1355, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1000, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1126, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1063, in async_calculate_state if state_attributes := self.state_attributes: ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 324, in getattribute return super().getattribute(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 557, in state_attributes data[ATTR_PRESET_MODE] = self.preset_mode ^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 324, in getattribute return super().getattribute(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/functools.py", line 995, in get val = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 639, in preset_mode return self._attr_preset_mode ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 324, in getattribute return super().getattribute(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 324, in getattribute return super().getattribute(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'TasmotaIrhvac' object has no attribute 'attr_preset_mode'. Did you mean: 'attr_preset_modes'?

confuzius0815 commented 3 months ago

Hi, Not a solution, but a workaround: I had the same problem and it did no longer occur with HA core 2024.6.2 after downgrading (from backup).

andrewwong2000 commented 3 months ago

Thanks for the tip.. I tried downgrading to 2024.6.2 with no luck, and also tried to downgrade to 2024.5.5.

Will keep trying !

confuzius0815 commented 3 months ago

Hi, One more thing I did: Before downgrading HA to 2024.6.2, I switched back the the latest commits (which I first thought would solve my problem). So actually now I am on 2024.6.2 with HA and on 2024.6.1 with this integration (at least I think so, do not remeber exactly my steps): https://github.com/hristo-atanasov/Tasmota-IRHVAC/tree/v2024.6.1

Thinking about it, that commit might be the problem with HA (at least 2024.6.3)? : https://github.com/hristo-atanasov/Tasmota-IRHVAC/commit/de5a190852e4e9fc69d19bdcc23076b8c0946320

Have a nice weekend.

nao-pon commented 3 months ago

@andrewwong2000 There was a member variable initialization error, so I fixed it. It will be reflected in the next version. You can download the master from this integration of HACS and try it. Thanks! 👍

andrewwong2000 commented 3 months ago

Thanks so much ! It works again