Skip to content

断网重连后部分蓝牙mesh设备无法自动重连,需要手动重载插件 #686

Open
@refined-fish

Description

Describe the Bug / 描述问题

由于 停电 PPPoE在线超时 路由器重启 等原因,外网连接有时会发生中断,尽管中断只是暂时的,但重新连接外网后总是有部分蓝牙mesh设备无法重连,在HomeAssistan中显示为离线状态。只有手动重载插件,或者重启HomeAssistan才可重连。

How to Reproduce / 复现步骤

  1. 由各种事件导致外网链接暂时性断开
  2. 外网链接恢复,设备开始陆续在线
  3. 但是部分蓝牙mesh设备始终无法重连,如下图

Image

Expected Behavior / 预期结果

最好的情况是完全本地控制,但是我的中枢网关尚未接收到推送,但是目前预期结果也应该是断网回复后能够尽快恢复所有设备的在线状态。

Reproduce Time / 问题复现的时间点

2025-01-22 4:28:34

Home Assistant Logs / 系统日志

问题发生的时间节点我没有开启集成日志的debug,如果有办法获取日志并且需要,还请告诉我

断网时间似乎只有一条检测网络问题的日志如下

此错误来自自定义集成。

日志记录器: homeassistant
来源: custom_components/xiaomi_home/miot/miot_mips.py:1033
集成: Xiaomi Home (文档, 问题)
首次出现: 04:28:12 (1 次总计出现)
上次记录: 04:28:12

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/xiaomi_home/miot/miot_client.py", line 1073, in __on_mips_cloud_state_changed
    self.__update_device_msg_sub(did=did)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/config/custom_components/xiaomi_home/miot/miot_client.py", line 965, in __update_device_msg_sub
    self._mips_cloud.unsub_prop(did=did)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/config/custom_components/xiaomi_home/miot/miot_mips.py", line 910, in unsub_prop
    return self.__unreg_broadcast_external(topic=topic)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_home/miot/miot_mips.py", line 1033, in __unreg_broadcast_external
    self._internal_loop.call_soon_threadsafe(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self.__unreg_broadcast, topic)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 873, in call_soon_threadsafe
    self._check_closed()
    ~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 551, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

然后在11点(断网后7小时且设备仍未链接),有一条日志

此错误来自自定义集成。

日志记录器: custom_components.xiaomi_home.miot.miot_client
来源: custom_components/xiaomi_home/miot/miot_mips.py:1141
集成: Xiaomi Home (文档, 问题)
首次出现: 2025年1月18日 13:10:37 (5657 次总计出现)
上次记录: 11:20:54

地名, mips try reconnect after 6s
地名, mips try reconnect after 12s
地名, mips try reconnect after 24s
地名, mips try reconnect after 48s
地名, mips try reconnect after 60s

Log Timezone / 日志时区

asia/shanghai

Home Assistant Core Version / Home Assistant Core 版本

2025.1.2

Home Assistant Operation System Version / Home Assistant Operation System 版本

14.1

Xiaomi Home Integration Version / 米家集成版本

v0.1.5b2

Additional Context / 其他说明

或许与https://github.com/XiaoMi/ha_xiaomi_home/issues/500相似

出现问题的掉线设备类型为蓝牙mesh灯泡 giot.light.v5ssm yeelink.light.mbulb3 ,其连接网关为小米中枢网关,其余设备工作均正常

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions