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

Websocket_API #117717

Open
ronjtaylor opened this issue May 19, 2024 · 4 comments
Open

Websocket_API #117717

ronjtaylor opened this issue May 19, 2024 · 4 comments

Comments

@ronjtaylor
Copy link

ronjtaylor commented May 19, 2024

The problem

My system becomes unresponsive. Comes back and then goes again. I had to restore to a backup that I thought might be more stable. However it still has the error that I have loaded from the logs but my HA seems to be more stable.

What version of Home Assistant Core has the issue?

core 2024.5.1

What was the last working version of Home Assistant Core?

core 2024.3.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Zigbee

Link to integration documentation on our website

No response

Diagnostics information

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 4:33:46 PM (3 occurrences)
Last logged: 4:34:35 PM

[139646119120832] Unexpected exception
[139644528172992] Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 342, in request
    return await req.result
           ^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 64, in wrap_zigpy_exceptions
    yield
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 84, in wrapper
    return await RETRYABLE_REQUEST_DECORATOR(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/util.py", line 131, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/zcl/__init__.py", line 377, in request
    return await self._endpoint.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request
    return await self.device.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 341, in request
    async with asyncio_timeout(timeout):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/switch.py", line 99, in async_turn_off
    await self._on_off_cluster_handler.turn_off()
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/general.py", line 453, in turn_off
    result = await self.off()
             ^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 83, in wrapper
    with wrap_zigpy_exceptions():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 66, in wrap_zigpy_exceptions
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Failed to send request: device did not respond

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

I have tried updating to latest update 2024.5.4 but my HA just then becomes inaccessible via browser for some time. It does come back for a few minutes and that's when it allows me enough time to restore to a backup that I knew was not as unstable.
This version (2024.5.1) still has the same errors in log file but does not seem to want to lock me out.

@home-assistant
Copy link

Hey there @dmulcahey, @Adminiuga, @puddly, @TheJulianJES, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of zha 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 zha 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)


zha documentation
zha source
(message by IssueLinks)

@puddly
Copy link
Contributor

puddly commented May 19, 2024

Delivery errors are normal for ZigBee networks, as devices are often unavailable. You'll need to collect a debug log from the version that cannot start, as otherwise there isn't enough info to figure this problem out.

@ronjtaylor
Copy link
Author

I will need help here as I am not sure how to collect a debug log from the version that cannot start? Could you please guide me on how to collect this data. Thank you.

There were about 4 devices that did not start after a restart or reboot unless I manually gave them a cold power reset. These devices used to start prior to these latest updates,
This is the details of one of them
image

HA has now been running for just over a day and this morning when I accessed it all Zigbee devices up and working without my intervention. Maybe not, as last night I did manually use the on/off button on one devices which controls a desk lamp from a power outlet as the lamp was on and I wanted to turn it off.
Thank you

@wim-bart
Copy link

I have exactly the same issue and it looked to be fixed until last Saturday. I have exact the same Tuga based plugs, but also a repeater in the network. For over half a year everything worked like a charm with zag and those plugs. But upgrading from version 2024.3.x to 2024.5.1 and higher I cannot get it stable anymore.

At the moment even new plugs get unstable and lose connection. I switched Zigbee channel (needing me to re-pair all devices) to avoid conflict with my WiFi. But a cannot get it stable. Even did use a 3m USB cable for my Sonoff coordinator.

It drives me to madness because when I am on a trip I need to control some devices and now I am not able to do so.

Devices just disappear to never come back, sometimes I need to physically unplug all devices to get my network be up again for maybe a day maximum.

And if it was only limited to the Plugs, no other devices also. And I see strange behaviour. Last night I removed power from a device and when I plugged it in it started to get into pairing mode, out of nowhere.

Somehow it looks like zha is doing very strange things.

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

No branches or pull requests

7 participants