mdeweerd / zha-toolkit

🧰 Zigbee Home Assistant Toolkit - service for "rare" Zigbee operations using ZHA on Home Assistant
GNU General Public License v3.0
203 stars 33 forks source link

ZHA command gives back "Failed to perform the action zha_toolkit.attr_read. Unknown error" for every command I try #266

Open freakyjoe8 opened 2 months ago

freakyjoe8 commented 2 months ago

Hi,

I've reinstalled HA with 2024.9.2, installed ZHA and ZHA toolkit. I'm now trying to execute commands to my zigbee network via ZHA toolkit. Unfortunately I get back "Failed to perform the action zha_toolkit.attr_read. Unknown error" for every command I try to execute. I tried it with ZHA tookit versions v1.1.19 and v1.1.21.

Log says for a attribute read command:

2024-09-25 20:48:17.302 ERROR (MainThread) [custom_components.zha_toolkit] Exception '00:1f:ee:00:00:00:xx:xx' for service call with data '{'zha_toolkit_version': 'v1.1.19', 'zigpy_version': '0.66.0', 'zigpy_rf_version': '0.40.6', 'ieee_org': 00:1f:ee:00:00:00:xx:xx, 'ieee': '00:1f:ee:00:00:00:xx:xx', 'command': 'attr_read', 'command_data': None, 'start_time': '2024-09-25T18:48:17.299925+00:00', 'errors': ['KeyError(00:1f:ee:00:00:00:xx:xx)'], 'params': {'endpoint_id': 1, 'cluster_id': 258, 'attr_id': 4098, 'dir': 0, 'manf': 4338, 'tries': 1, 'expect_reply': True, 'args': [], 'read_before_write': True, 'read_after_write': True}, 'success': False}'
2024-09-25 20:48:17.303 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 00:1f:ee:00:00:00:xx:xx
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/__init__.py", line 828, in toolkit_service
    raise handler_exception
  File "/config/custom_components/zha_toolkit/__init__.py", line 784, in toolkit_service
    handler_result = await handler(
                     ^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/__init__.py", line 894, in command_handler_default
    return await default.default(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/default.py", line 51, in default
    await handler(app, listener, ieee, cmd, data, service, params, event_data)
  File "/config/custom_components/zha_toolkit/zcl_attr.py", line 311, in attr_read
    await attr_write(*args, **kwargs)
  File "/config/custom_components/zha_toolkit/zcl_attr.py", line 321, in attr_write
    dev = await u.get_device(app, listener, ieee)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/utils.py", line 382, in get_device
    return app.get_device(ieee)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 1270, in get_device
    return self.devices[ieee]
           ~~~~~~~~~~~~^^^^^^
KeyError: 00:1f:ee:00:00:00:xx:xx
Q-V-91 commented 1 month ago

I've got the same issue since the HA September update, no clue what to do now.

kridness commented 1 month ago

Here the same... See also issue #248

Can someone give an estimated time for fixing this problem?

Ragetti13 commented 1 week ago

I am experiencing the same issue as well.

Core: 2024.11.1 Supervisor: 2024.11.2 Operating System: 13.2