core icon indicating copy to clipboard operation
core copied to clipboard

ZHA Conbee II set up error

Open PaRkThEcAr opened this issue 2 years ago • 9 comments

The problem

Home Assistant Container core version: 2022.11.0 device: ConBee II verison 0x26780700

When setting up the Conbee II i get everything running successfully. however, after the intigration is set up i am met with this error.

Source: components/zha/core/gateway.py:172 
First occurred: 1:37:10 PM (2 occurrences) 
Last logged: 1:41:57 PM

Error setting up entry ConBee II for zha
Error setting up entry ConBee II, s/n: DE2292685 - dresden elektronik ingenieurtechnik GmbH for zha
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 137, in change_loop
    await asyncio.sleep(CHANGE_NETWORK_WAIT)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 605, in sleep
    return await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 111, in start_network
    await self._change_network_state(NetworkState.CONNECTED)
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 140, in _change_network_state
    await asyncio.wait_for(change_loop(), timeout=timeout)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 112, in async_setup_entry
    await zha_gateway.async_initialize()
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 185, in async_initialize
    raise exc
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize
    self.application_controller = await app_controller_cls.new(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 144, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 125, in startup
    await self.initialize(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 107, in initialize
    await self.start_network()
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 113, in start_network
    raise FormationFailure() from e
zigpy.exceptions.FormationFailure```

and this error:

```Logger: homeassistant.components.zha.core.gateway
Source: components/zha/core/gateway.py:172 
Integration: Zigbee Home Automation ([documentation](https://www.home-assistant.io/integrations/zha), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+zha%22)) 
First occurred: 1:36:43 PM (6 occurrences) 
Last logged: 1:41:57 PM

Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator (attempt 1 of 3)
Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator (attempt 2 of 3)
Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator (attempt 3 of 3)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 137, in change_loop
    await asyncio.sleep(CHANGE_NETWORK_WAIT)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 605, in sleep
    return await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 111, in start_network
    await self._change_network_state(NetworkState.CONNECTED)
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 140, in _change_network_state
    await asyncio.wait_for(change_loop(), timeout=timeout)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize
    self.application_controller = await app_controller_cls.new(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 144, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 125, in startup
    await self.initialize(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 107, in initialize
    await self.start_network()
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 113, in start_network
    raise FormationFailure() from e
zigpy.exceptions.FormationFailure```



### What version of Home Assistant Core has the issue?

2022.11.0

### What was the last working version of Home Assistant Core?

NA (it has never worked)

### What type of installation are you running?

Home Assistant Container

### Integration causing the issue

Zigbee Home Automation

### Link to integration documentation on our website

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

### Diagnostics information

```Logger: homeassistant.config_entries
Source: components/zha/core/gateway.py:172 
First occurred: 1:37:10 PM (2 occurrences) 
Last logged: 1:41:57 PM

Error setting up entry ConBee II for zha
Error setting up entry ConBee II, s/n: DE2292685 - dresden elektronik ingenieurtechnik GmbH for zha
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 137, in change_loop
    await asyncio.sleep(CHANGE_NETWORK_WAIT)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 605, in sleep
    return await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 111, in start_network
    await self._change_network_state(NetworkState.CONNECTED)
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 140, in _change_network_state
    await asyncio.wait_for(change_loop(), timeout=timeout)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 112, in async_setup_entry
    await zha_gateway.async_initialize()
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 185, in async_initialize
    raise exc
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize
    self.application_controller = await app_controller_cls.new(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 144, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 125, in startup
    await self.initialize(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 107, in initialize
    await self.start_network()
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 113, in start_network
    raise FormationFailure() from e
zigpy.exceptions.FormationFailure```

and this error:

```Logger: homeassistant.components.zha.core.gateway
Source: components/zha/core/gateway.py:172 
Integration: Zigbee Home Automation ([documentation](https://www.home-assistant.io/integrations/zha), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+zha%22)) 
First occurred: 1:36:43 PM (6 occurrences) 
Last logged: 1:41:57 PM

Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator (attempt 1 of 3)
Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator (attempt 2 of 3)
Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator (attempt 3 of 3)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 137, in change_loop
    await asyncio.sleep(CHANGE_NETWORK_WAIT)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 605, in sleep
    return await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 111, in start_network
    await self._change_network_state(NetworkState.CONNECTED)
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 140, in _change_network_state
    await asyncio.wait_for(change_loop(), timeout=timeout)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize
    self.application_controller = await app_controller_cls.new(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 144, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 125, in startup
    await self.initialize(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 107, in initialize
    await self.start_network()
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 113, in start_network
    raise FormationFailure() from e
zigpy.exceptions.FormationFailure```


### Example YAML snippet

_No response_

### Anything in the logs that might be useful for us?

```txt
: homeassistant.config_entries
Source: components/zha/core/gateway.py:172 
First occurred: 1:37:10 PM (2 occurrences) 
Last logged: 1:41:57 PM

Error setting up entry ConBee II for zha
Error setting up entry ConBee II, s/n: DE2292685 - dresden elektronik ingenieurtechnik GmbH for zha
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 137, in change_loop
    await asyncio.sleep(CHANGE_NETWORK_WAIT)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 605, in sleep
    return await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 111, in start_network
    await self._change_network_state(NetworkState.CONNECTED)
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 140, in _change_network_state
    await asyncio.wait_for(change_loop(), timeout=timeout)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 112, in async_setup_entry
    await zha_gateway.async_initialize()
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 185, in async_initialize
    raise exc
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize
    self.application_controller = await app_controller_cls.new(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 144, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 125, in startup
    await self.initialize(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 107, in initialize
    await self.start_network()
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 113, in start_network
    raise FormationFailure() from e
zigpy.exceptions.FormationFailure

and this error:

```Logger: homeassistant.components.zha.core.gateway
Source: components/zha/core/gateway.py:172 
Integration: Zigbee Home Automation ([documentation](https://www.home-assistant.io/integrations/zha), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+zha%22)) 
First occurred: 1:36:43 PM (6 occurrences) 
Last logged: 1:41:57 PM

Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator (attempt 1 of 3)
Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator (attempt 2 of 3)
Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator (attempt 3 of 3)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 137, in change_loop
    await asyncio.sleep(CHANGE_NETWORK_WAIT)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 605, in sleep
    return await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 111, in start_network
    await self._change_network_state(NetworkState.CONNECTED)
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 140, in _change_network_state
    await asyncio.wait_for(change_loop(), timeout=timeout)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize
    self.application_controller = await app_controller_cls.new(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 144, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 125, in startup
    await self.initialize(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 107, in initialize
    await self.start_network()
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 113, in start_network
    raise FormationFailure() from e
zigpy.exceptions.FormationFailure```

Additional information

No response

PaRkThEcAr avatar Nov 03 '22 19:11 PaRkThEcAr

Hey there @dmulcahey, @adminiuga, @puddly, 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 Change the title of 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 03 '22 19:11 home-assistant[bot]

I too am facing this error

enviousjag avatar Nov 04 '22 09:11 enviousjag

I too am facing this error

Ragbak99 avatar Nov 04 '22 09:11 Ragbak99

The provided logs seem to be incomplete from what I can see at a quick glance.

So, just to provide the basic Conbee setup instructions:

  • use a USB 2.0 extension or plug it in a USB 2.0 port
  • make sure it's not near any USB SSDs, Bluetooth sticks, WiFi APs, ...

It's possible that the network doesn't form because of too much interference.

TheJulianJES avatar Nov 04 '22 09:11 TheJulianJES

This is what I'm seeing. Not sure if OP has anything similar.

2022-11-04 11:17:59.164 ERROR (MainThread) [zigpy.application] Couldn't start application Nov 04 11:17:59 Home Assistant[1771]: Traceback (most recent call last): Nov 04 11:17:59 Home Assistant[1771]: File "/mnt/_userdata/homeassistant/deps/lib/python3.9/site-packages/zigpy/application.py", line 125, in startup Nov 04 11:17:59 Home Assistant[1771]: await self.initialize(auto_form=auto_form) Nov 04 11:17:59 Home Assistant[1771]: File "/mnt/_userdata/homeassistant/deps/lib/python3.9/site-packages/zigpy/application.py", line 110, in initialize Nov 04 11:17:59 Home Assistant[1771]: await self.permit(0) Nov 04 11:17:59 Home Assistant[1771]: File "/mnt/_userdata/homeassistant/deps/lib/python3.9/site-packages/zigpy/application.py", line 932, in permit Nov 04 11:17:59 Home Assistant[1771]: await zigpy.zdo.broadcast( Nov 04 11:17:59 Home Assistant[1771]: File "/mnt/_userdata/homeassistant/deps/lib/python3.9/site-packages/zigpy/device.py", line 516, in broadcast Nov 04 11:17:59 Home Assistant[1771]: return await app.broadcast( Nov 04 11:17:59 Home Assistant[1771]: File "/mnt/_userdata/homeassistant/deps/lib/python3.9/site-packages/zigpy/application.py", line 747, in broadcast Nov 04 11:17:59 Home Assistant[1771]: await self.send_packet( Nov 04 11:17:59 Home Assistant[1771]: File "/mnt/_userdata/homeassistant/deps/lib/python3.9/site-packages/zigpy_deconz/zigbee/application.py", line 419, in send_packet Nov 04 11:17:59 Home Assistant[1771]: raise zigpy.exceptions.DeliveryError( Nov 04 11:17:59 Home Assistant[1771]: zigpy.exceptions.DeliveryError: Failed to deliver packet: <TXStatus.MAC_CHANNEL_ACCESS_FAILURE: 225>

enviousjag avatar Nov 04 '22 10:11 enviousjag

MAC_CHANNEL_ACCESS_FAILURE is your Conbee basically giving up, as there's too much interference.

You should be able to solve this using the steps I provided in my previous comment. (USB extension, ...)

TheJulianJES avatar Nov 04 '22 12:11 TheJulianJES

MAC_CHANNEL_ACCESS_FAILURE is your Conbee basically giving up, as there's too much interference.

You should be able to solve this using the steps I provided in my previous comment. (USB extension, ...)

Thanks for stressing this point. My ZHA network started throwing this error after over a year of no problems. Moved the Conbee about 6 inches further from my Wi-Fi AP, restarted ZHA, and everything was back to normal 🤷‍♂️

eddiegrau avatar Nov 06 '22 15:11 eddiegrau

I'm seeing this after upgrading to core 2022.11 as well. I did not have any issues with interference before the upgrade whatsoever. If this is really related to interference, did the ZHA/zigpy implementation change some thresholds or otherwise got more sensitive?

Also, could this be a duplicate of #81057 ?

Edit: fixed for me. Power-cycled the Raspi. Yet, a bit strange to see this symptoms after an upgrade.

brnhffmnn avatar Nov 06 '22 16:11 brnhffmnn

This is at the radio level. Zigpy does not control it nor have access to this low level.

Adminiuga avatar Nov 06 '22 16:11 Adminiuga

The provided logs seem to be incomplete from what I can see at a quick glance.

So, just to provide the basic Conbee setup instructions:

* **use a USB 2.0 extension** or plug it in a USB 2.0 port

* make sure it's not near any USB SSDs, Bluetooth sticks, WiFi APs, ...

It's possible that the network doesn't form because of too much interference.

You save my day, thanks!

gruessung avatar Nov 14 '22 10:11 gruessung

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.