Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Xiaomi Multimode Gateway 2 FW version 1.0.7_0019 be used for ZHA? #1525

Open
Huiyuen07 opened this issue Dec 26, 2024 · 12 comments
Open
Assignees
Labels
question Further information is requested

Comments

@Huiyuen07
Copy link

I have a Xiaomi Multimode Gateway 2 with firmware version 1.0.7 and sucessfully got the key via uart and setup the integration, but I cannot setup via ZHA for zigbee control. It showed unknow errors occurs or connection fails (sth like that as the interface is in Chinese). My aim is use the device as a zigbee controller for multiple vendors' product. Anything I should do before setup ZHA? Do I need to flash any other firmware? Thanks.

Device Information

extra:
  cloud_fw: 1.0.7_0019
  cloud_name: Xiaomi Smart Home Hub 2
  did: '499189137'
  fw_ver: 1.0.7_0019
  mac: 54:ef:44:43:ef:10
  mac2: 18:C2:3C:06:1D:3F
  market_brand: Xiaomi
  market_model: ZNDMWG04LM, BHR6765GL
  market_name: Multimode Gateway 2 EU
  rssi: -13
  type: gateway
last_report:
  channel: 0
last_report_gw:
  fw_ver: 1.0.7_0019
  host: 192.168.1.91
  mac: 54:ef:44:43:ef:10
  model: lumi.gateway.mgl001
  name: Xiaomi Smart Home Hub 2
last_report_ts: 1m
last_request_ts: 1m
last_seen: {}
listeners: 3
model: lumi.gateway.mgl001
params:
  brightness: 255.0
  channel: 0
  led: true
  power_tx: 0
ttl: 0s
uid: 54ef4443ef10

image

@AlexxIT AlexxIT added the question Further information is requested label Dec 26, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Dec 26, 2024

This version should be supported. Check HA logs.

@Huiyuen07
Copy link
Author

Huiyuen07 commented Dec 27, 2024

記錄器: bellows.thread
來源: components/zha/config_flow.py:285
首次發生: 上午8:07:42 (3 事件)
最後紀錄: 上午8:07:42

Attempted to use a closed event loop

記錄器: aiohttp.server
來源: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:451
首次發生: 上午8:07:42 (1 事件)
最後紀錄: 上午8:07:42

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        flow, cur_step["step_id"], user_input
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/config_flow.py", line 285, in async_step_manual_port_config
    if await self._radio_mgr.radio_type.controller.probe(user_input):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/zigpy/application.py", line 633, in probe
    await app.disconnect()
  File "/usr/local/lib/python3.13/site-packages/bellows/zigbee/application.py", line 454, in disconnect
    await self._ezsp.disconnect()
  File "/usr/local/lib/python3.13/site-packages/bellows/ezsp/__init__.py", line 205, in disconnect
    await self._gw.disconnect()
TypeError: object NoneType can't be used in 'await' expression

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 27, 2024

Looks like some bug in the ZHA integration.

@Huiyuen07
Copy link
Author

I have set up the integration. Any things I should do further to enable the connection via ZHA? For example, may I assume the default port is 8888?

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 27, 2024

You're doing everything right. This is TypeError: object NoneType can't be used in 'await' expression some internal error in the ZHA integration.

@Huiyuen07
Copy link
Author

Anyway to fix it?

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 28, 2024

Probably you need to ask the person who supports this integration.

@RayzenOri
Copy link

I have this same problem with my gateway (this same model and firmware).
image

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 28, 2024

Screenshots won't help. Need the exact error from the logs.

@RayzenOri
Copy link

I do not know where to find such information, in settings - system - logs there is nothing. I am new with home assistant.

@RayzenOri
Copy link

I also tried with zigbee2mqtt edge. Here I have a problem with starting the service. Unlike zha here I have a logs tab so I have something to show.
Config:
image
Logs after start:

[21:09:39] INFO: Preparing to start...
[21:09:39] INFO: Socat not enabled
[21:09:40] INFO: Starting Zigbee2MQTT...
Starting Zigbee2MQTT without watchdog.
[2024-12-28 21:09:44] info: z2m: Logging to console, file (filename: log.log)
[2024-12-28 21:09:44] info: z2m: Starting Zigbee2MQTT version 1.42.0-dev (commit #120a5b4)
[2024-12-28 21:09:44] info: z2m: Starting zigbee-herdsman (3.2.0)
[2024-12-28 21:09:44] warning: zh:ezsp: 'ezsp' driver is deprecated and will only remain to provide support for older firmware (pre 7.4.x). Migration to 'ember' is recommended. If using Zigbee2MQTT see Koenkk/zigbee2mqtt#21462
[2024-12-28 21:09:44] error: zh:ezsp:ezsp: Connection attempt 1 error: Error: connect ECONNREFUSED 192.168.88.17:8888
[2024-12-28 21:09:49] error: zh:ezsp:ezsp: Connection attempt 2 error: Error: connect ECONNREFUSED 192.168.88.17:8888
[2024-12-28 21:09:59] error: zh:ezsp:ezsp: Connection attempt 3 error: Error: connect ECONNREFUSED 192.168.88.17:8888
[2024-12-28 21:10:14] error: zh:ezsp:ezsp: Connection attempt 4 error: Error: connect ECONNREFUSED 192.168.88.17:8888
[2024-12-28 21:10:14] error: z2m: Error while starting zigbee-herdsman
[2024-12-28 21:10:14] error: z2m: Failed to start zigbee-herdsman
[2024-12-28 21:10:14] error: z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions
[2024-12-28 21:10:14] error: z2m: Exiting...
[2024-12-28 21:10:14] error: z2m: Error: Failure to connect
at Ezsp.connect (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:364:19)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at Driver.startup (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/driver.ts:186:13)
at EZSPAdapter.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ezsp/adapter/ezspAdapter.ts:145:16)
at Controller.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/controller.ts:136:29)
at Zigbee.start (/app/lib/zigbee.ts:69:27)
at Controller.start (/app/lib/controller.ts:142:13)
at start (/app/index.js:161:5)

@AlexxIT AlexxIT self-assigned this Dec 29, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Dec 29, 2024

OK. I will try to check ZHA on latest gateway firmware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants