core icon indicating copy to clipboard operation
core copied to clipboard

ZHA delays with Tuya mmWave sensors

Open a-d-r-i-a-n-d opened this issue 1 year ago • 127 comments

The problem

Since I've upgraded to 2024.1.0 my ZigBee devices (lights, switches, fans etc) are having a few seconds/minutes delay in responding to commands. I have tried to restore to previous versions but the issue still persist, no matter the version I am restoring to. I have also tried restarting in safe mode, but it didn't helped. Any help is much appreciated!

What version of Home Assistant Core has the issue?

core-2024.1.0

What was the last working version of Home Assistant Core?

core-2023.12.3

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

config_entry-zha-1122b1901b65684e9e9a05c89bd2a54d.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.zha.core.cluster_handlers
Source: components/zha/core/cluster_handlers/__init__.py:537
Integration: Zigbee Home Automation (documentation, issues)
First occurred: 23:36:04 (7 occurrences)
Last logged: 23:40:47

[0xEA69:1:0x0702]: async_initialize: all attempts have failed: [DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>')]
[0xEA69:1:0x0b04]: async_initialize: all attempts have failed: [DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>')]
[0x85AF:1:0x0702]: async_initialize: all attempts have failed: [DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>')]
[0x85AF:1:0x0006]: async_initialize: all attempts have failed: [DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>')]
[0x85AF:1:0x0b04]: async_initialize: all attempts have failed: [DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>')]

Additional information

System Information

version core-2024.1.0
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.63-haos
arch x86_64
timezone Europe/London
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4955
Installed Version 1.33.0
Stage running
Available Repositories 1371
Downloaded Repositories 7
HACS Data ok
Home Assistant Cloud
logged_in true
subscription_expiration 22 January 2024 at 00:00
relayer_connected true
relayer_region eu-central-1
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled false
remote_server eu-central-1-9.ui.nabu.casa
certificate_status ready
instance_id 8bf80b83acdc431081381385ed2692e2
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 11.2
update_channel stable
supervisor_version supervisor-2023.12.1
agent_version 1.6.0
docker_version 24.0.7
disk_total 58.0 GB
disk_used 12.2 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons EMQX (0.3.0), Samba share (12.2.0), Studio Code Server (5.14.2), openWakeWord (1.8.2), Advanced SSH & Web Terminal (17.0.1)
Dashboards
dashboards 2
resources 1
views 12
mode storage
MercedesME 2020
websocket_connection_state connected
api_endpoint_reachable ok
Recorder
oldest_recorder_run 21 December 2023 at 17:55
current_recorder_run 4 January 2024 at 23:22
estimated_db_size 308.77 MiB
database_engine sqlite
database_version 3.41.2

a-d-r-i-a-n-d avatar Jan 04 '24 23:01 a-d-r-i-a-n-d

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)

home-assistant[bot] avatar Jan 04 '24 23:01 home-assistant[bot]

I have tried to restore to previous versions but the issue still persist, no matter the version I am restoring to.

This sounds like an environmental problem.

Is your coordinator on a USB extension cable and away from 2.4GHz interference sources such as any USB 3.0 port or device, SSD, etc.?

puddly avatar Jan 04 '24 23:01 puddly

Hi @puddly ,

Thanks for getting back so quick. Yes it is. I have 95 Zigbee devices connected and never had any issues in years.

a-d-r-i-a-n-d avatar Jan 05 '24 00:01 a-d-r-i-a-n-d

I have 95 Zigbee devices connected and never had any issues in years.

If downgrading doesn't change anything, it's not a software problem. Your debug log says that channel 15 has a utilization of 86%, which is probably why you're having delays. Something in your environment changed recently and is causing noise and interference. It may have been neighbors.

If you are 100% certain no nearby devices could be interfering, change the ZHA channel from the configuration page. Leave the channel selection dialog on Auto so that ZHA picks the best channel for you (likely 20):

image

puddly avatar Jan 05 '24 00:01 puddly

Thanks, will change the channel as per your advice. Does this change require commissioning the devices again?

a-d-r-i-a-n-d avatar Jan 05 '24 00:01 a-d-r-i-a-n-d

I tried several times to change the channel but the blue wheel keeps spinning and no changes are applied, even after reboot it's still 15.

Screenshot 2024-01-05 at 00 30 37

a-d-r-i-a-n-d avatar Jan 05 '24 00:01 a-d-r-i-a-n-d

Changing the channel takes about a minute. How long did you wait?

puddly avatar Jan 05 '24 00:01 puddly

I've had to unplug the coordinator and plug back in, after that the change has been applied. The channel is now 25. Here are some errors I see in the logs:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:610
Integration: Sensor (documentation, issues)
First occurred: 00:53:13 (26 occurrences)
Last logged: 00:53:13

Platform zha does not generate unique IDs. ID a4:c1:38:b5:e0:e0:f7:97-1-2820-rms_voltage already exists - ignoring sensor.guest_bedroom_trv_voltage
Platform zha does not generate unique IDs. ID a4:c1:38:b5:e0:e0:f7:97-1-1794-summation_delivered already exists - ignoring sensor.guest_bedroom_trv_summation_delivered
Platform zha does not generate unique IDs. ID a4:c1:38:d5:3d:87:92:f3-1-2820-rms_current already exists - ignoring sensor.master_bedroom_trv_current
Platform zha does not generate unique IDs. ID a4:c1:38:d5:3d:87:92:f3-1-2820-rms_voltage already exists - ignoring sensor.master_bedroom_trv_voltage
Platform zha does not generate unique IDs. ID a4:c1:38:d5:3d:87:92:f3-1-1794-summation_delivered already exists - ignoring sensor.master_bedroom_trv_summation_delivered

and

Logger: zigpy.zcl
Source: runner.py:188
First occurred: 00:51:55 (11219 occurrences)
Last logged: 00:53:14

[0xBCE4:1:0xef00] Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 411, in reply return await self._endpoint.reply( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/endpoint.py", line 278, in reply return await self.device.reply( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 483, in reply return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 317, in request await send_request File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 833, in request await self.send_packet( File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 868, in send_packet status, _ = await self._ezsp.sendUnicast( ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'sendUnicast'
[0x61BF:1:0xef00] Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 411, in reply return await self._endpoint.reply( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/endpoint.py", line 278, in reply return await self.device.reply( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 483, in reply return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 317, in request await send_request File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 833, in request await self.send_packet( File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 868, in send_packet status, _ = await self._ezsp.sendUnicast( ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'sendUnicast'
[0x07A8:1:0xef00] Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 411, in reply return await self._endpoint.reply( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/endpoint.py", line 278, in reply return await self.device.reply( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 483, in reply return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 317, in request await send_request File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 833, in request await self.send_packet( File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 868, in send_packet status, _ = await self._ezsp.sendUnicast( ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'sendUnicast'
[0x5289:1:0xef00] Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 411, in reply return await self._endpoint.reply( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/endpoint.py", line 278, in reply return await self.device.reply( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 483, in reply return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 317, in request await send_request File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 833, in request await self.send_packet( File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 868, in send_packet status, _ = await self._ezsp.sendUnicast( ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'sendUnicast'
[0xE160:1:0xe001] Unknown cluster command 225 b'\n\xfc\x00*-;\x00\x00\x00:\x00\x00\x009\x00\x00\x008\x00\x00\x006\x00\x00\x004\x00\x00\x002\x00\x00\x000\x00\x00\x00/\x00\x00\x00.\x00\x00\x00\x01'

a-d-r-i-a-n-d avatar Jan 05 '24 00:01 a-d-r-i-a-n-d

Changing the channel takes about a minute. How long did you wait?

Much more than that.

a-d-r-i-a-n-d avatar Jan 05 '24 00:01 a-d-r-i-a-n-d

Utilization on channel 15 in the past has always been between 80% - 90% and it was working just fine. It looks like on channel 25 has been reduced to 78.25% but still having the same delay issue.

Logger: zigpy.application
Source: components/zha/core/gateway.py:211
First occurred: 01:03:47 (2 occurrences)
Last logged: 01:03:47

Zigbee channel 25 utilization is 78.25%!
If you are having problems joining new devices, are missing sensor updates, or have issues keeping devices joined, ensure your coordinator is away from interference sources such as USB 3.0 devices, SSDs, WiFi routers, etc.

a-d-r-i-a-n-d avatar Jan 05 '24 01:01 a-d-r-i-a-n-d

Now is down to 75.96%! by repositioning the coordinator. Issue still persist so if you have other ideas please let me know.

a-d-r-i-a-n-d avatar Jan 05 '24 01:01 a-d-r-i-a-n-d

honestly, I am facing similar issues for a couple of days now... For me, everything seemed to start on the day, two things have changed:

  1. Installed 2024.1. beta 0b0
  2. Paired another 2.4GHz device which is not using the zigbee protocoll, but working on the default channel 15 (afaik)

The issues became more worse each day - until nothing has worked anymore - resulting in a complete rebuild of the Network and switching to Channel 25.

Now, I have a feeling, that the issues slowly comming back... right now, most devices seem to respond, but I am already getting warnings in the logs as you have shared... Zigbee channel utilization is pretty high, devices do not respond (right now, only one...)

I need to investigate into this further over the weekend, because right now I have some ideas what might cause this - but need to change the location of some devices and monitor the behave after such changes...

Comming back to your topic:

  • Has something changed on your network?
  • Did you add another Wireless device?
  • is there a particular device responding slow? or are all of them affected?

If it is one device in particular, you can try to remove this one - to see, if it could be a defect on the device itself...

ChristophCaina avatar Jan 05 '24 05:01 ChristophCaina

same issue here since 2024.1 NO environment changes!

after a full reboot of HAOS it is lightning-fast but is getting slower and slower after a few minutes . after some hjours horrible slow

marc4s avatar Jan 05 '24 08:01 marc4s

Current usb extension cable is only 2 meters long so have ordered a 5 meters which should arrive today. I'll report later if any improvements but I doubt there are environment changes.

a-d-r-i-a-n-d avatar Jan 05 '24 09:01 a-d-r-i-a-n-d

SAme issues here . I bought a 2m cable ( from 1m ) .. let' see arrive tomorrow

frank777777 avatar Jan 05 '24 09:01 frank777777

downgrading to last working 2023.12.4 "fixed" it for me

marc4s avatar Jan 05 '24 09:01 marc4s

can you confirm , is not delays all zigbees devices right? .. only smartplug for me

frank777777 avatar Jan 05 '24 09:01 frank777777

downgrading to last working 2023.12.4 "fixed" it for me

  OS Version:               Home Assistant OS 11.3
  Home Assistant Core:      2024.1.0

  Home Assistant URL:       http://homeassistant.local:8123
  Observer URL:             http://homeassistant.local:4357
➜  ~ ha core update --version=2023.12.4
Processing... Done.

Command completed successfully.

This downgrade using the command ha core update --version=2023.12.4 seems to have fix it for me also. To mention that in the first 3 minutes after any reboot, the delay is still there, but after that, every command is executed instantly, as it should.

a-d-r-i-a-n-d avatar Jan 05 '24 10:01 a-d-r-i-a-n-d

Hi. Interesting. My zigbee network is totally down after upgrade to 2024.1.0.

I opened discussion here: https://community.home-assistant.io/t/after-upgrade-to-2024-1-0-zigbee-is-gone-with-failed-to-send-request-failed-to-enqueue-message-after-3-attempts-emberstatus-no-buffers-24/666757/

marmolak avatar Jan 05 '24 13:01 marmolak

I have had issues with ZHA after the upgrade to 2024.1.0 as well. In my case it wasn't just a delay but commands were timing out and I was not able to control the lights. ~~Downgrading to 2023.12.4 solved the issue.~~

Edit: I was too quick to confirm 2023.12.4 was the solution. I have downgraded to 2023.12.3 and after almost a day, no issues. So this seems to be the good version. I have seen in the release notes of 2023.12.4 a version bump update of ZHA, that may be the culprit.

This seems to be the latest ZHA change until today: https://github.com/home-assistant/core/pull/106147

tanerpaca avatar Jan 05 '24 13:01 tanerpaca

Naive bug against zigpy is here: https://github.com/zigpy/zigpy/issues/1315

marmolak avatar Jan 05 '24 13:01 marmolak

update : Downgrading to 2023.12.4 solved the issue. IS NOT solving the issue ( on me ) . worked perfect for couple of minutes , and 7/9 interaction , then delay are back again . :(

frank777777 avatar Jan 05 '24 16:01 frank777777

update : Downgrading to 2023.12.3 solved the issue.

frank777777 avatar Jan 05 '24 17:01 frank777777

Update to 2024.1.1 doesn't help :(.

marmolak avatar Jan 05 '24 18:01 marmolak

Also having quite some issues with Zigbee devices since 2023.12.4. Last stable working is 2023.12.3, so i guess it must have been a change introduced in between that.

merdok avatar Jan 05 '24 20:01 merdok

Same here. Issues with Zigbee since 2024.1.0. I went quickly from 2023.12.4 to 2024.1.0 so I'm not sure whether 2023.12.4 had issues as well. Identical symptoms to other people who've posted here.

christabone avatar Jan 06 '24 01:01 christabone

Quick update: The long extension cable didn't helped, i am pretty sure this is not an environmental problem.

a-d-r-i-a-n-d avatar Jan 06 '24 09:01 a-d-r-i-a-n-d

2024.1.2 seems to have same issue :(. NO_BUFFERS.

marmolak avatar Jan 06 '24 15:01 marmolak

I have the same issues using 2024.1.2, Z2M, aqara motion sensors and sky connect just get really delayed after time. On 2023.12.4 everything is stable and fast.

pcieszkowski avatar Jan 06 '24 21:01 pcieszkowski

Same here again after upgrading from 2023.12.3 to 2024.1.1 and .2. All Zigbee devices respond slow.

logging: IMG_8798

schwickster avatar Jan 06 '24 22:01 schwickster