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

v1.1.19 - zha_devices failure #269

Open
XaF opened this issue Nov 2, 2024 · 3 comments
Open

v1.1.19 - zha_devices failure #269

XaF opened this issue Nov 2, 2024 · 3 comments

Comments

@XaF
Copy link

XaF commented Nov 2, 2024

Hello,

zha-toolkit is failing for some simple operations in my home assistant.
I'm using:

  • zha-toolkit v1.1.19
  • home-assistant v2024.10.4

And when I run the following service call:

action: zha_toolkit.zha_devices
data:
  event_done: zha_devices

I get the following error:

Failed to perform the action zha_toolkit.zha_devices. Unknown error

With the following logs: (putting the full traceback, but only the last file is part of zha-toolkit)

homeassistant  | Traceback (most recent call last):
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
homeassistant  |     await func(hass, connection, msg)
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 816, in handle_execute_script
homeassistant  |     script_result = await script_obj.async_run(
homeassistant  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1795, in async_run
homeassistant  |     return await asyncio.shield(create_eager_task(run.async_run()))
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run
homeassistant  |     await self._async_step(log_exceptions=False)
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step
homeassistant  |     self._handle_exception(
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception
homeassistant  |     raise exception
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step
homeassistant  |     await getattr(self, handler)()
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step
homeassistant  |     response_data = await self._async_run_long_action(
homeassistant  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action
homeassistant  |     return await long_task
homeassistant  |            ^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
homeassistant  |     response_data = await coro
homeassistant  |                     ^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
homeassistant  |     return await target(service_call)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/config/custom_components/zha_toolkit/__init__.py", line 817, in toolkit_service
homeassistant  |     u.get_hass(zha_gw).bus.fire(params[p.EVT_DONE], event_data)
homeassistant  |     ^^^^^^^^^^^^^^^^^^^^^^
homeassistant  | AttributeError: 'NoneType' object has no attribute 'bus'

I've seen other threads talking about issues that could be related to versions of home assistant, but the solution was generally to go to v1.1.19... but that's already the version I have!

@pvalsecc
Copy link

pvalsecc commented Nov 9, 2024

Same here with the 1.1.21, but it gives me more details:

Could not get hass from <zha.application.gateway.Gateway object at 0x7f64dc4320>.Attributes available ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_async_device_joined', '_async_device_rejoined', '_async_initialize', '_await_and_log_pending', '_background_tasks', '_cancel_cancellable_timers', '_device_availability_checker', '_device_init_tasks', '_devices', '_emit_group_gateway_message', '_event_tasks', '_find_coordinator_device', '_global_listeners', '_groups', '_handle_event_protocol', '_listeners', '_reload_task', '_tracked_completable_tasks', '_untracked_background_tasks', 'application_controller', 'async_add_executor_job', 'async_add_zha_job', 'async_block_till_done', 'async_create_background_task', 'async_create_task', 'async_create_zigpy_group', 'async_device_initialized', 'async_fetch_updated_state_mains', 'async_from_config', 'async_initialize', 'async_initialize_devices_and_entities', 'async_remove_device', 'async_remove_zigpy_group', 'async_run_zha_job', 'async_update_device', 'config', 'connection_lost', 'coordinator_zha_device', 'create_platform_entities', 'create_task', 'device_initialized', 'device_joined', 'device_left', 'device_removed', 'devices', 'emit', 'get_application_controller_data', 'get_device', 'get_group', 'get_or_create_device', 'get_or_create_group', 'global_updater', 'group_added', 'group_member_added', 'group_member_removed', 'group_removed', 'groups', 'handle_message', 'load_devices', 'load_groups', 'loop', 'on_all_events', 'on_event', 'once', 'radio_concurrency', 'radio_type', 'raw_device_initialized', 'shutdown', 'shutting_down', 'state', 'track_task'].

I have HASS version:

Core 2024.11.1
Supervisor 2024.11.2
Operating System 13.2
Interface utilisateur 20241106.2

@MikeBP13
Copy link

Same issue here...

@Jon87
Copy link

Jon87 commented Dec 12, 2024

Same here, I'm on v1.1.19

run
zha_toolkit.zha_devices

but get this error every time;

Failed to perform the action zha_toolkit.zha_devices. Unknown error

looking into the logs I can see this error;

  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/zha.py", line 48, in zha_devices
    devices = [device.zha_device_info for device in listener.devices.values()]
                                                    ^^^^^^^^^^^^^^^^
AttributeError: 'ZHAGatewayProxy' object has no attribute 'devices'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants