ZHA - Help with configuration

hi,

I’m trying configure Sonoff dongle using this guide: https://www.youtube.com/watch?v=xc_HGvrOxp8

i managed to install the integration without any issues:


in configration.yaml i have the following:
image

when i trying to add devices, i get the following errors in the logfile:

2020-10-06 13:57:50 ERROR (MainThread) [zigpy.application] Couldn’t start application
2020-10-06 13:57:50 ERROR (MainThread) [homeassistant.components.zha.core.gateway] Couldn’t start Legacy TI_CC = Texas Instruments Z-Stack ZNP protocol: CC253x, CC26x2, CC13x2 coordinator
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py”, line 147, in async_initialize
self.application_controller = await app_controller_cls.new(
File “/usr/local/lib/python3.8/site-packages/zigpy/application.py”, line 68, in new
await app.startup(auto_form)
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/zigbee/application.py”, line 110, in startup
await self.form_network()
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/zigbee/application.py”, line 132, in form_network
status = await start_znp(
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/zigbee/start_znp.py”, line 292, in start_znp
await boot(znp)
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/zigbee/start_znp.py”, line 144, in boot
await started.wait()
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/api.py”, line 47, in wait
return await asyncio.wait_for(self.future, self.timeout / 1000)
File “/usr/local/lib/python3.8/asyncio/tasks.py”, line 490, in wait_for
raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError
2020-10-06 13:57:50 WARNING (MainThread) [homeassistant.config_entries] Config entry for zha not ready yet. Retrying in 80 seconds
2020-10-06 13:58:12 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-10-06 13:58:36 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-10-06 13:58:44 WARNING (Thread-9) [pychromecast.socket_client] [פהימה(192.168.0.189):8009] Heartbeat timeout, resetting connection
2020-10-06 13:59:00 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-10-06 13:59:14 ERROR (Thread-9) [pychromecast.socket_client] [פהימה(192.168.0.189):8009] Failed to connect to service MIBOX3-364523ec9f3988bff47000333ec2e54d._googlecast._tcp.local., retrying in 5.0s
2020-10-06 13:59:24 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-10-06 13:59:32 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140081068268704] Received invalid command: zha/devices/permit
2020-10-06 13:59:48 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-10-06 13:59:49 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140081137988608] Client unable to keep up with pending messages. Stayed over 512 for 5 seconds
2020-10-06 14:00:12 WARNING (MainThread) [zigpy_cc.api] No response for: AREQ ZDO stateChangeInd {‘state’: 9}
2020-10-06 14:00:12 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-10-06 14:00:12 ERROR (MainThread) [zigpy.application] Couldn’t start application
2020-10-06 14:00:12 ERROR (MainThread) [homeassistant.components.zha.core.gateway] Couldn’t start Legacy TI_CC = Texas Instruments Z-Stack ZNP protocol: CC253x, CC26x2, CC13x2 coordinator
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py”, line 147, in async_initialize
self.application_controller = await app_controller_cls.new(
File “/usr/local/lib/python3.8/site-packages/zigpy/application.py”, line 68, in new
await app.startup(auto_form)
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/zigbee/application.py”, line 110, in startup
await self.form_network()
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/zigbee/application.py”, line 132, in form_network
status = await start_znp(
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/zigbee/start_znp.py”, line 292, in start_znp
await boot(znp)
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/zigbee/start_znp.py”, line 144, in boot
await started.wait()
File “/usr/local/lib/python3.8/site-packages/zigpy_cc/api.py”, line 47, in wait
return await asyncio.wait_for(self.future, self.timeout / 1000)
File “/usr/local/lib/python3.8/asyncio/tasks.py”, line 490, in wait_for
raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError
2020-10-06 14:00:12 WARNING (MainThread) [homeassistant.config_entries] Config entry for zha not ready yet. Retrying in 80 seconds
2020-10-06 14:00:30 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140081068268704] Received invalid command: zha/devices/permit"

"

I’m using VirtualBox running the latest version of home assistant :

cam someone help me to troubleshoot this issue?

I had the same problem. I found solution here.
It works without USB cable after installation.

@r.novak
hi,

what do you mean without usb cable, i am not using a cable. it’s a dongle that plugged directly to the computer.

Try getting a USB extension and adding the zigbee stick to that. many have found that the USB sticks are prone to interference and this can stop pairing amongst other things.

I gave up with ZHA to be honest - I just had so many issues getting devices to pair. I ended up switching to zigbee2mqtt but I still have issues. I have found that with Z"mqtt and my stick, which is I believe on the latest firmware (ebay purchase and will need to check) that it stops pairing after a while and the only way to get it to start again is to reboot, not just HA but the entire VM - I’m on proxmox BTW. Maybe this might work for you and ZHA?

you may also want to check the config of the USB port. that string looks a little short - for example mine is:

/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0014D96799-if00

but yours finishes at the ‘X’?

This is the problem with following instruction in old youtube videos. ZHA is now configured from the GUI unless you need to set special OTA parameters.

Follow the official docs and remove zha: from your config.yaml

I followed the docs, still had the issues outlined roughly above. good point though and should be tested/investigate by OP. As an aside I’m hitting paring probs with z2mqtt again but this is not the thread for it.