Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration Crash After Kernel Upgrade to 2024.12.0 - AttributeError in Versatile Thermostat Component #702

Closed
Rominic opened this issue Dec 11, 2024 · 17 comments
Labels
bug Something isn't working developed When development is done and tested enhancement New feature or request P1 Priority 1

Comments

@Rominic
Copy link

Rominic commented Dec 11, 2024

Hello,

After upgrading to kernel version 2024.12.0 and the subsequent versions up to 2024.12.2, the integration started to crash. This issue seems similar to the problems reported in the following threads:

claudegel/sinope-gt125#71
home-assistant/core#132437

Configuration

Core: 2024.12.2
Supervisor: 2024.11.4
Operating System: 14.0
Frontend: 20241127.6
Versatile thermostat: 6.8.2

My VTherm attributes are the following:

hvac_modes: 
min_temp: 16
max_temp: 28
target_temp_step: 0.5
preset_modes: none, frost, eco, comfort, boost
current_temperature: null
temperature: 28
preset_mode: none
is_on: true
hvac_action: null
hvac_mode: heat
type: null
is_controlled_by_central_mode: false
last_central_mode: null
frost_temp: 16
eco_temp: 20
boost_temp: 22.5
comfort_temp: 20.5
frost_away_temp: 16
eco_away_temp: 17
boost_away_temp: 21
comfort_away_temp: 17
power_temp: null
target_temperature_step: 0.5
ext_current_temperature: null
ac_mode: true
current_power: null
current_power_max: null
saved_preset_mode: none
saved_target_temp: 28
saved_hvac_mode: null
motion_sensor_entity_id: null
motion_state: null
power_sensor_entity_id: null
max_power_sensor_entity_id: null
overpowering_state: null
presence_sensor_entity_id: input_boolean.presence_detector
presence_state: null
window_state: off
window_auto_state: off
window_bypass_state: false
window_sensor_entity_id: null
window_delay_sec: null
window_auto_enabled: false
window_auto_open_threshold: null
window_auto_close_threshold: null
window_auto_max_duration: null
window_action: window_turn_off
security_delay_min: 60
security_min_on_percent: 0.5
security_default_on_percent: 0.1
last_temperature_datetime: 2024-12-11T09:45:08.053409+01:00
last_ext_temperature_datetime: 2024-12-11T09:45:08.053409+01:00
security_state: false
minimal_activation_delay_sec: 10
device_power: 1
mean_cycle_power: null
total_energy: 0
last_update_datetime: 2024-12-11T09:45:08.053461+01:00
timezone: Europe/Paris
temperature_unit: °C
is_device_active: false
nb_device_actives: 0
ema_temp: null
is_used_by_central_boiler: false
temperature_slope: 0
hvac_off_reason: null
max_on_percent: null
have_valve_regulation: false
is_over_climate: true
start_hvac_action_date: null
underlying_entities: climate.climatisation_chambre_room_temperature
is_regulated: true
regulated_target_temperature: 28
auto_regulation_mode: auto_regulation_strong
regulation_accumulated_error: 0
auto_fan_mode: auto_fan_none
current_auto_fan_mode: null
auto_activated_fan_mode: null
auto_deactivated_fan_mode: null
auto_regulation_use_device_temp: false
auto_start_stop_enable: false
auto_start_stop_level: auto_start_stop_none
auto_start_stop_dtmin: null
auto_start_stop_accumulated_error: 0
auto_start_stop_accumulated_error_threshold: null
auto_start_stop_last_switch_date: null
follow_underlying_temp_change: false
friendly_name: Thermostat chambre
supported_features: 401

Describe the bug

After upgrading to kernel version 2024.12.0 and subsequent versions up to 2024.12.2, the integration crashes. The issue appears to be related to a change in how certain attributes are accessed or initialized, as seen in the error trace below.

Debug log

Enregistreur: homeassistant
Source: components/climate/__init__.py:337
S'est produit pour la première fois: 09:36:45 (223 occurrences)
Dernier enregistrement: 14:38:34

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/versatile_thermostat/__init__.py", line 128, in _async_startup_internal
    await api.init_vtherm_links()
  File "/config/custom_components/versatile_thermostat/vtherm_api.py", line 189, in init_vtherm_links
    await entity.async_startup(self.find_central_configuration())
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 613, in async_startup
    await self.get_my_previous_state()
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 851, in get_my_previous_state
    self.send_event(EventType.PRESET_EVENT, {"preset": self._attr_preset_mode})
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 2837, in send_event
    send_vtherm_event(self._hass, event_type=event_type, entity=self, data=data)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/versatile_thermostat/const.py", line 494, in send_vtherm_event
    data["state_attributes"] = entity.state_attributes
                               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 584, in state_attributes
    data[ATTR_SWING_HORIZONTAL_MODE] = self.swing_horizontal_mode
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "src/propcache/_helpers_c.pyx", line 80, in propcache._helpers_c.cached_property.__get__
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 719, in swing_horizontal_mode
    return self._attr_swing_horizontal_mode
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
AttributeError: 'ThermostatOverClimate' object has no attribute '__attr_swing_horizontal_mode'. Did you mean: '_attr_swing_horizontal_mode'?

Additional Information

Error encountered: AttributeError: 'ThermostatOverClimate' object has no attribute '__attr_swing_horizontal_mode'

@jmcollin78
Copy link
Owner

Hello I'm currenlty on 2024.12.1 without any issue. I will try to understand what happens. If someone have an idea...

Can you please give me the attributes of the underlying climate ?

@jmcollin78 jmcollin78 added the bug Something isn't working label Dec 12, 2024
@jmcollin78 jmcollin78 added the P1 Priority 1 label Dec 12, 2024
@Rominic
Copy link
Author

Rominic commented Dec 13, 2024

Hello JmCollin,

Thank you for your help! The underlying thermostat is actually a Daikin air conditioner, controllable via the daikin_onecta integration. I hadn’t encountered any issues with it until an update two days ago. Since then, I’ve noticed the same type of error as with Versatile, and I can no longer control the air conditioner through Home Assistant.

By reverting to the previous version of daikin_onecta, the problem disappeared. I’ll report this issue to them as well.

For reference, here are the current state attributes of the air conditioner:

hvac_modes:
  - "off"
  - heat_cool
  - dry
  - cool
  - heat
  - fan_only
min_temp: 10
max_temp: 30
target_temp_step: 0.5
fan_modes:
  - quiet
  - auto
  - "1"
  - "2"
  - "3"
  - "4"
  - "5"
preset_modes:
  - away
  - boost
  - none
swing_modes:
  - stop
  - swing
swing_horizontal_modes:
  - stop
  - swing
current_temperature: 18
temperature: 16
fan_mode: quiet
preset_mode: none
swing_mode: stop
swing_horizontal_mode: stop
icon: mdi:air-conditioner
friendly_name: Climatisation Chambre
supported_features: 953

Do you think there’s anything else I can provide or do to help?

@Rominic
Copy link
Author

Rominic commented Dec 13, 2024

Small clarification, I did try downgrading the version of Versatile to 6.7.0, but the error is still present.

@jmcollin78
Copy link
Owner

swing_mode: stop
swing_horizontal_mode: stop

Hello @Rominic ,

I think swing_horizontal_mode is new attributes in climate entities. Because your device seems to support it (supported_features: 953) but not VTherm, you now have this error.

I will have to add it.

@jmcollin78 jmcollin78 added the enhancement New feature or request label Dec 14, 2024
@jmcollin78
Copy link
Owner

That is why: https://developers.home-assistant.io/blog/2024/12/03/climate-horizontal-swing

At each major release of HA, there is breaking change on Thermostat which are not mentionned. This is very annoying.

jmcollin78 pushed a commit that referenced this issue Dec 14, 2024
jmcollin78 added a commit that referenced this issue Dec 14, 2024
Co-authored-by: Jean-Marc Collin <[email protected]>
@jmcollin78
Copy link
Owner

Can you try this and let me know if it fixes the issue. Thank you.

@Maabou08
Copy link

Bonjour,

cela ne fonctionne toujours pas

mais maintenant j'ai 2 erreur :
voici les erreurs

Cette erreur provient d'une intégration personnalisée

Enregistreur: py.warnings
Source: custom_components/versatile_thermostat/underlyings.py:255
intégration: Versatile Thermostat configuration (documentation, problèmes)
S'est produit pour la première fois: 19:12:48 (1 occurrences)
Dernier enregistrement: 19:12:48

/config/custom_components/versatile_thermostat/underlyings.py:255: RuntimeWarning: coroutine 'UnderlyingEntity.set_hvac_mode' was never awaited super().set_hvac_mode(hvac_mode)

et

Cette erreur provient d'une intégration personnalisée

Enregistreur: custom_components.versatile_thermostat.base_thermostat
Source: custom_components/versatile_thermostat/base_thermostat.py:833
intégration: Versatile Thermostat configuration (documentation, problèmes)
S'est produit pour la première fois: 19:12:48 (1 occurrences)
Dernier enregistrement: 19:12:48

No previously saved temperature, setting to 7.0

@axelbd
Copy link

axelbd commented Dec 14, 2024

Hello,
I had the same error as @Rominic as I also use daikin_onecta as underlying thermostat. I did a test with HA 2024.12.3, daikin_onecta v4.2.2 and Versatile Thermostat v6.8.3 but I still have the error below.

If i rollback daikin_onecta prior to the addition of the new horizontal swing attribute (v4.1.22) it works again.
@jmcollin78 I see only version changes in your commit #708, where can I find the other change you made please?
A big thanks for your custom integration and your support by the way.

Best regards,

First message is new, i only saw it once.

2024-12-14 21:21:42.090 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'versatile_thermostat' sets option flow config_entry explicitly, which is deprecated at custom_components/versatile_thermostat/config_flow.py, line 934: self.config_entry = config_entry. This will stop working in Home Assistant 2025.12, please create a bug report at https://github.com/jmcollin78/versatile_thermostat/issues
2024-12-14 21:23:11.283 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] No previously saved temperature, setting to 29.0
2024-12-14 21:23:11.294 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry VTherm PAC Salon 2 for versatile_thermostat
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/versatile_thermostat/__init__.py", line 183, in async_setup_entry
    await api.init_vtherm_links(entry.entry_id)
  File "/config/custom_components/versatile_thermostat/vtherm_api.py", line 189, in init_vtherm_links
    await entity.async_startup(self.find_central_configuration())
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 737, in async_startup
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 2702, in async_write_ha_state
    return super().async_write_ha_state()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1081, in __async_calculate_state
    capability_attr = self.capability_attributes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 530, in capability_attributes
    data[ATTR_SWING_HORIZONTAL_MODES] = self.swing_horizontal_modes
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "src/propcache/_helpers_c.pyx", line 80, in propcache._helpers_c.cached_property.__get__
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 727, in swing_horizontal_modes
    return self._attr_swing_horizontal_modes
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
AttributeError: 'ThermostatOverClimate' object has no attribute '__attr_swing_horizontal_modes'. Did you mean: '_attr_swing_horizontal_modes'?

@Rominic
Copy link
Author

Rominic commented Dec 14, 2024

So unfortunately, as Maabou08 explains, the issue is not resolved, and I have the following errors in the logs :
I applied the latest updates available before testing. Is there any way I can assist further?

2024-12-15 00:32:14.324 WARNING (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Thermostat chambre - Undefined target temperature, falling back to 28.0
2024-12-15 00:32:14.326 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Thermostat chambre for versatile_thermostat
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/versatile_thermostat/__init__.py", line 183, in async_setup_entry
    await api.init_vtherm_links(entry.entry_id)
  File "/config/custom_components/versatile_thermostat/vtherm_api.py", line 189, in init_vtherm_links
    await entity.async_startup(self.find_central_configuration())
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 737, in async_startup
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 2702, in async_write_ha_state
    return super().async_write_ha_state()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1081, in __async_calculate_state
    capability_attr = self.capability_attributes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 530, in capability_attributes
    data[ATTR_SWING_HORIZONTAL_MODES] = self.swing_horizontal_modes
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "src/propcache/_helpers_c.pyx", line 80, in propcache._helpers_c.cached_property.__get__
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 727, in swing_horizontal_modes
    return self._attr_swing_horizontal_modes
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
AttributeError: 'ThermostatOverClimate' object has no attribute '__attr_swing_horizontal_modes'. Did you mean: '_attr_swing_horizontal_modes'?
2024-12-15 00:32:51.974 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140209138797728] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 1084, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 1453, in async_set_temperature
    self.recalculate()
    ~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 581, in recalculate
    self.update_custom_attributes()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 567, in update_custom_attributes
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 2702, in async_write_ha_state
    return super().async_write_ha_state()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1081, in __async_calculate_state
    capability_attr = self.capability_attributes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 530, in capability_attributes
    data[ATTR_SWING_HORIZONTAL_MODES] = self.swing_horizontal_modes
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "src/propcache/_helpers_c.pyx", line 80, in propcache._helpers_c.cached_property.__get__
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 727, in swing_horizontal_modes
    return self._attr_swing_horizontal_modes
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
AttributeError: 'ThermostatOverClimate' object has no attribute '__attr_swing_horizontal_modes'. Did you mean: '_attr_swing_horizontal_modes'?
2024-12-15 00:33:00.486 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 895, in _async_climate_changed
    await end_climate_changed(changes)
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 651, in end_climate_changed
    self.update_custom_attributes()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 567, in update_custom_attributes
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 2702, in async_write_ha_state
    return super().async_write_ha_state()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1081, in __async_calculate_state
    capability_attr = self.capability_attributes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 530, in capability_attributes
    data[ATTR_SWING_HORIZONTAL_MODES] = self.swing_horizontal_modes
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "src/propcache/_helpers_c.pyx", line 80, in propcache._helpers_c.cached_property.__get__
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 727, in swing_horizontal_modes
    return self._attr_swing_horizontal_modes
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
AttributeError: 'ThermostatOverClimate' object has no attribute '__attr_swing_horizontal_modes'. Did you mean: '_attr_swing_horizontal_modes'?
2024-12-15 00:33:00.489 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 895, in _async_climate_changed
    await end_climate_changed(changes)
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 651, in end_climate_changed
    self.update_custom_attributes()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 567, in update_custom_attributes
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 2702, in async_write_ha_state
    return super().async_write_ha_state()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1081, in __async_calculate_state
    capability_attr = self.capability_attributes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 530, in capability_attributes
    data[ATTR_SWING_HORIZONTAL_MODES] = self.swing_horizontal_modes
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "src/propcache/_helpers_c.pyx", line 80, in propcache._helpers_c.cached_property.__get__
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 727, in swing_horizontal_modes
    return self._attr_swing_horizontal_modes
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
AttributeError: 'ThermostatOverClimate' object has no attribute '__attr_swing_horizontal_modes'. Did you mean: '_attr_swing_horizontal_modes'?
2024-12-15 00:33:25.533 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 1555, in _async_ext_temperature_changed
    self.recalculate()
    ~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 581, in recalculate
    self.update_custom_attributes()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/thermostat_climate.py", line 567, in update_custom_attributes
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/versatile_thermostat/base_thermostat.py", line 2702, in async_write_ha_state
    return super().async_write_ha_state()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1081, in __async_calculate_state
    capability_attr = self.capability_attributes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 530, in capability_attributes
    data[ATTR_SWING_HORIZONTAL_MODES] = self.swing_horizontal_modes
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "src/propcache/_helpers_c.pyx", line 80, in propcache._helpers_c.cached_property.__get__
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 727, in swing_horizontal_modes
    return self._attr_swing_horizontal_modes
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 337, in __getattribute__
    return super().__getattribute__(name)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
AttributeError: 'ThermostatOverClimate' object has no attribute '__attr_swing_horizontal_modes'. Did you mean: '_attr_swing_horizontal_modes'?```

@VederJay
Copy link

Same issue here on a new install (only just started using versatile thermostat), also Daikin.

@jmcollin78
Copy link
Owner

Hello all,

Because I cannot reproduce on my env, it is not easy to fix. Does someone have the skill to make a PR and fix the issue directly on your env ? I would be glad to merge it quickly.

@VederJay
Copy link

I can make the changes locally to test it if you can give me an idea where to add the lines as proposed by sbeaudion.

@jmcollin78
Copy link
Owner

I would love it @VederJay !

@jmcollin78
Copy link
Owner

I have posted a message on the core thread.

jmcollin78 pushed a commit that referenced this issue Dec 21, 2024
@jmcollin78
Copy link
Owner

Hello,

I made a 2nd try to fix this issue in this beta release: https://github.com/jmcollin78/versatile_thermostat/releases/tag/6.8.4.beta1

Please give it a try and let me know.

@jmcollin78 jmcollin78 added the developed When development is done and tested label Dec 21, 2024
@Maabou08
Copy link

Bonjour

version 6.8.4 beta 2 installée

je n'ai plus d'erreur pour l'instant et

cela a l'air de fonctionne correctement

merci beaucoup pour votre belle application,
très utile pour la geston de mon chauffage

et surtout d'avoir pris le temps de corrige rapidement votre application.

encore MERCI

@jmcollin78
Copy link
Owner

Elle sera donc dans la prochaine release. Merci pour le retour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working developed When development is done and tested enhancement New feature or request P1 Priority 1
Projects
None yet
Development

No branches or pull requests

5 participants