home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.09k stars 29.75k forks source link

Atlantic Heat Recovery Ventilation device prevents all IO devices states update #122980

Open flgrm2 opened 1 month ago

flgrm2 commented 1 month ago

The problem

Action: trigger an IO device (blind) connected through Overkiz (Tahoma Box)

What happens: An error message pops-up / the device is triggered / its state on the dashboard doesn't change

Error message pop-up: _Failed to call service cover/set_coverposition. 'NoneType' object has no attribute 'get'

Example : triggering a blind to close in the dashboard actually closes it, but the blind is still shown as open in the dashboard. Only a reload of the Overkiz integration update its state.

Investigating the issue, logs seems to point to the atlantic_heat_recovery_ventilation.py file when trying to get the ventilation mode.

What version of Home Assistant Core has the issue?

2024.7.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

overkiz

Link to integration documentation on our website

https://www.home-assistant.io/integrations/overkiz/

Diagnostics information

config_entry-overkiz-01J456BXQD2YQWCRAVFPG03AG6.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:241
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 22:01:49 (5 occurrences)
Last logged: 23:48:19

[547757101488] Unexpected exception
[547181299744] Unexpected exception
[547362295088] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/overkiz/cover_entities/vertical_cover.py", line 99, in async_set_cover_position
    await self.executor.async_execute_command(OverkizCommand.SET_CLOSURE, position)
  File "/usr/src/homeassistant/homeassistant/components/overkiz/executor.py", line 111, in async_execute_command
    await self.coordinator.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 288, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 411, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 165, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 491, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1133, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1070, in __async_calculate_state
    if state_attributes := self.state_attributes:
                           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 318, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 553, in state_attributes
    data[ATTR_FAN_MODE] = self.fan_mode
                          ^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 318, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/overkiz/climate_entities/atlantic_heat_recovery_ventilation.py", line 141, in fan_mode
    cooling = ventilation_mode.get(OverkizCommandParam.COOLING)
              ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

Additional information

I didn't notice exactly when this error started to appear : as I moved to a voice-based control, I rarely used the dashboard anymore. But the issue was not there when I was still on 2023.x.x a few months ago (big upgrade from 2023.x.x to 2024.5 or so...)

home-assistant[bot] commented 1 month ago

Hey there @imicknl, @vlebourl, @tetienne, @nyrodev, @tronix117, @alexfp14, mind taking a look at this issue as it has been labeled with an integration (overkiz) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `overkiz` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign overkiz` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


overkiz documentation overkiz source (message by IssueLinks)

iMicknl commented 2 days ago

Thanks for reporting! It seems your device / hub has been updated and now the AtlanticHeatRecoveryVentilation doesn't provide the ventilation_mode and setVentilationMode anymore.

We will need to check if your device supports this, and otherwise not pull the (non existing) state.