core icon indicating copy to clipboard operation
core copied to clipboard

Issue when turning off a zigbee siren

Open mbo18 opened this issue 2 years ago • 6 comments

The problem

I have a Zigbee siren (Heiman/Tuya) that behaves strangely when turned off: it turn off, then on, then off, then on and off again and the following message appears: "Failed to call service siren/turn_off: Failed to send request: device did not respond"

Capture

See below for logs, full logs and diagnostic file.

What version of Home Assistant Core has the issue?

core-2023.11.1

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

ZHA

Link to integration documentation on our website

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

Diagnostics information

home-assistant_zha_2023-11-07T16-10-05.871Z.log

zha-95c77e74d2b4495da8daadb3ed59c27a-_TYZB01_8scntis1 TS0216-18e3838705d2e058ef87dc0e16adc06f.json (1).txt

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:230
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 16:53:45 (2 occurrences)
Last logged: 16:53:46

[139621778379840] Failed to send request: device did not respond
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 314, 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.11/site-packages/zigpy/util.py", line 138, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 377, in request
    return await self._endpoint.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/endpoint.py", line 253, in request
    return await self.device.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 313, in request
    async with asyncio_timeout(timeout):
  File "/usr/local/lib/python3.11/asyncio/timeouts.py", line 111, 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 230, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/siren/__init__.py", line 117, in async_handle_turn_on_service
    await siren.async_turn_on(
  File "/usr/src/homeassistant/homeassistant/components/zha/siren.py", line 146, in async_turn_on
    await self._cluster_handler.issue_start_warning(
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/security.py", line 330, in issue_start_warning
    await self.start_warning(
  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.11/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  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

Additional information

No response

mbo18 avatar Nov 07 '23 16:11 mbo18

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.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

home-assistant[bot] avatar Nov 07 '23 16:11 home-assistant[bot]

Can you also add diagnostics JSON for the ZHA integration?

puddly avatar Nov 07 '23 16:11 puddly

To add more information, it used to work fine some times ago. I don't know when it stopped because I do not turn on and off my siren often

mbo18 avatar Nov 07 '23 16:11 mbo18

Did you find something @puddly? Today my siren did not turned on when using the service form the automation. What I don't understand is that it works only when I use the siren switch from the device's page.

Got this log when my alarm triggered today:

2023-12-25 12:37:58.715 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities siren.entree are missing or not currently available
2023-12-25 12:38:08.238 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities siren.entree are missing or not currently available
2023-12-25 12:39:24.646 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140466947040576] Failed to send request: device did not respond
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 316, 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.11/site-packages/zigpy/util.py", line 138, in retry
return await func()
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 377, in request
return await self._endpoint.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/zigpy/endpoint.py", line 253, in request
return await self.device.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 315, in request
async with asyncio_timeout(timeout):
File "/usr/local/lib/python3.11/asyncio/timeouts.py", line 111, 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 238, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2067, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2104, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 878, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/siren/__init__.py", line 117, in async_handle_turn_on_service
await siren.async_turn_on(
File "/usr/src/homeassistant/homeassistant/components/zha/siren.py", line 146, in async_turn_on
await self._cluster_handler.issue_start_warning(
File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/security.py", line 330, in issue_start_warning
await self.start_warning(
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.11/contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
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

I'm using HAOS 2023.12.3 now. config_entry-zha-95c77e74d2b4495da8daadb3ed59c27a.json.txt

mbo18 avatar Dec 25 '23 17:12 mbo18

Ok just discovered that it works fine when using device instead of entity in my automation: Before:

  action:
    - service: siren.turn_on
      target:
        entity_id: siren.entree

After:

  action:
    - type: warn
      domain: zha
      device_id: 18e3838705d2e058ef87dc0e16adc06f

Also discovered that I have a Warn or Squawk action but no Stop :/ Capture d’écran 2023-12-25 à 18 31 10

So I need to use the device to stop it because it won't stop when using the entity: Before:

  action:
    - service: siren.turn_off
      target:
        entity_id: siren.entree

After:

  action:
    - service: siren.turn_off
      target:
        device_id:
          - 18e3838705d2e058ef87dc0e16adc06f

Even when using the device, I have this in my logs:

Logger: homeassistant.components.automation.alarm_disarmed
Source: components/automation/__init__.py:676
Integration: Automation (documentation, issues)
First occurred: 18:34:03 (2 occurrences)
Last logged: 18:38:39

Error while executing automation automation.alarm_disarmed: Failed to send request: device did not respond

mbo18 avatar Dec 25 '23 17:12 mbo18

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Not stale

mbo18 avatar Mar 24 '24 18:03 mbo18

any new news on this?

i still have the problem, that the siren doesn't turn off after the given time

error is the same as the one from the topic owner

scherwa avatar May 14 '24 15:05 scherwa

No news unfortunately. Issue is still ongoing

mbo18 avatar May 14 '24 16:05 mbo18