Idead/Sonoff Wireless Zigbee Bridge (Pro) ZHA integration configuration error

Hey guys,

first post here so let me know if anything is wrong or should be done differently.
I flashed and installed my Sonoff Wifi Zigbee Bridge according to this (and other) reads: Setup the Sonoff ZBBridge-P on Home Assistant with ZHA | Dialedin

However, during the first attempt of configuring it as ZHA coordinator I received a dialog just saying “Error” with no text or buttons. This happened after entering the socket etc. and pressing"submit". I was asked whether I want to create a new network or import an existing one.
I retried the setup process, but after that all I could get was an “Unknown error occured”
grafik

In the Tasmota console it recognizes an incoming connection attempt every time I try submitting the configuration in HA, and I get the following error in the HA core log:

Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421
First occurred: 22:40:20 (11 occurrences)
Last logged: 23:37:48

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/nvram.py", line 177, in osal_read
    read_rsp = await self.znp.request(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/api.py", line 1068, in request
    raise InvalidCommandResponse(
zigpy_znp.exceptions.InvalidCommandResponse: Expected SRSP response SYS.OSALNVReadExt.Rsp(Status=<Status.SUCCESS: 0>, Value=None), got SYS.OSALNVReadExt.Rsp(Status=<Status.INVALID_PARAMETER: 2>, Value=b'')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 320, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 416, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/config_flow.py", line 271, in async_step_manual_port_config
    return await self.async_step_verify_radio()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/config_flow.py", line 316, in async_step_verify_radio
    return await self.async_step_choose_formation_strategy()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/config_flow.py", line 332, in async_step_choose_formation_strategy
    await self._radio_mgr.async_load_network_settings()
  File "/usr/src/homeassistant/homeassistant/components/zha/radio_manager.py", line 254, in async_load_network_settings
    await app.load_network_info()
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/zigbee/application.py", line 144, in load_network_info
    await self._znp.load_network_info(load_devices=load_devices)
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/api.py", line 238, in load_network_info
    await self._load_network_info(load_devices=load_devices)
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/api.py", line 142, in _load_network_info
    key_desc = await self.nvram.osal_read(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/nvram.py", line 191, in osal_read
    raise SecurityError(
zigpy_znp.exceptions.SecurityError: NV item cannot be read due to security constraints: <OsalNvIds.NWK_ACTIVE_KEY_INFO: 58>

I know the Wifi Bridges arent generally recommended because of instability but I wanted to connect at least one device to it… :smiley:

I obviously tried several restarts, resets and power cycles of both the Bridge and HA, as well as resetting the Tasmota configuration on the bridge.

I read about the Zigbee configuration file being corrupt, but I could not find any file called ‘zigbee.db’ on the file system. Where should it be located ? My theory is that the file doesn’t exist yet because the setup exited prematurely.

Thank you for your help!

I have exactly the same issue. Did you find a solution @roland_reich12 ?

On first try it asked me whether I want to create a new network or import an existing one. After that this constant unknown error.

Sadly not unitl now.
I’ve been busy with other projects, so I couldnt try it myself.
Please keep me updated if you find a solution.

@roland_reich12 I managed to resolve my issue and now everything is working smoothly.

I recommend following the steps outlined in the “Flashing coordinator firmware on Sonoff ZB Bridge Pro” section of this guide: Tasmota on Sonoff ZB Bridge Pro. Make sure to flash the coordinator properly as described.

If you encountered the same problem as I did, it’s likely due to not flashing the coordinator correctly. During the flashing process, be sure to leave it in the stuck state for at least 5 minutes before checking the console. This might help resolve the issue for you.

All the best!

Thanks for your reply.
After the firmware flashing, how did you include it in HA?
Add an integration with “Zigbee Home Automation” and then chose “ZNP” before entering “socket://ip:8888”?

I still get a “Connection Error” for that.

EDIT: After following these steps (Sonoff ZigBee Bridge Pro – Tasmota flashing und Homeassistant Integration – ATLANE) I needed to activate the TCP server.
Then it finally did work!