『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1834|回复: 2

[技术探讨] ZHA无法启动了Failed to set up,几番折腾反而系统彻底崩溃

[复制链接]

103

主题

758

帖子

2657

积分

金牌会员

Rank: 6Rank: 6

积分
2657
金钱
1899
HASS币
0
发表于 2023-1-14 19:17:30 | 显示全部楼层 |阅读模式
本帖最后由 Clark 于 2023-1-21 22:02 编辑

Error setting up entry socket://192.168.1.20:8888 for zha
7:04:21 PM – (ERROR) components/zha/core/gateway.py
Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 1 of 3)
7:04:21 PM – (WARNING) Zigbee Home Automation - message first occurred at 7:04:14 PM and shows up 3 times

考虑将最近升级的程序退回旧版本了,考虑 退回到 core_2023.1.2

当前 Home Assistant 2023.1.4                Supervisor 2022.12.1                Operating System 9.4                                  Frontend 20230110.0 - latest      


尝试退回到core_2023.1.1以及 core_2023.1.2都失败了,会导致HA无法启动,只能重启虚拟机。  


接下来尝试退回Z2M到addon_45df7312_zigbee2mqtt_1.29.1-1,这个版本。当前版本是1.29.2-1     


更麻烦了,几番恢复系统备份操作以后,HA直接丢失了所有配置,再次进入HA已经是初始化状态了。

几番折腾,反而变成了一切归零了。

HA丢失配置.JPG                            


CLI.JPG

2023年1月15日:HA一晚上过去第二天早上又自己恢复了之前的系统配置,这次赶紧用群辉VMM做一个系统快照,以防不测。尝试将core退回到 core_2023.1.0,还是导致HA丢失访问。再次尝试重启VMM虚拟机以后,终于core降级到2023.1.0版本了。
目前版本如下  
                Home Assistant 2023.1.0                Supervisor 2022.12.1                Operating System 9.4                                  Frontend 20230104.0 - latest           


ZHA还是无法正常工作,Failed to set up          :

Logger: homeassistant.config_entries
Source: components/zha/core/gateway.py:172
First occurred: 9:28:58 PM (1 occurrences)
Last logged: 9:28:58 PM

Error setting up entry socket://192.168.1.20:8888 for zha
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 111, 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 151, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 131, in startup
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/bellows/zigbee/application.py", line 124, in connect
    self._ezsp = await bellows.ezsp.EZSP.initialize(self.config)
  File "/usr/local/lib/python3.10/site-packages/bellows/ezsp/__init__.py", line 101, in initialize
    await ezsp.connect(use_thread=zigpy_config[conf.CONF_USE_THREAD])
  File "/usr/local/lib/python3.10/site-packages/bellows/ezsp/__init__.py", line 118, in connect
    self._gw = await bellows.uart.connect(self._config, self, use_thread=use_thread)
  File "/usr/local/lib/python3.10/site-packages/bellows/uart.py", line 389, in connect
    protocol, connection_done = await thread.run_coroutine_threadsafe(
  File "/usr/local/lib/python3.10/site-packages/bellows/uart.py", line 368, in _connect
    transport, protocol = await zigpy.serial.create_serial_connection(
  File "/usr/local/lib/python3.10/site-packages/zigpy/serial.py", line 36, in create_serial_connection
    transport, protocol = await loop.create_connection(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
    return await fut
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 535, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.1.20', 8888)
Logger: homeassistant.components.zha.core.gateway
Source: components/zha/core/gateway.py:172
Integration: Zigbee Home Automation (documentation, issues)
First occurred: 9:28:51 PM (3 occurrences)
Last logged: 9:28:58 PM

Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 1 of 3)
Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 2 of 3)
Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 3 of 3)
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 151, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 131, in startup
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/bellows/zigbee/application.py", line 124, in connect
    self._ezsp = await bellows.ezsp.EZSP.initialize(self.config)
  File "/usr/local/lib/python3.10/site-packages/bellows/ezsp/__init__.py", line 101, in initialize
    await ezsp.connect(use_thread=zigpy_config[conf.CONF_USE_THREAD])
  File "/usr/local/lib/python3.10/site-packages/bellows/ezsp/__init__.py", line 118, in connect
    self._gw = await bellows.uart.connect(self._config, self, use_thread=use_thread)
  File "/usr/local/lib/python3.10/site-packages/bellows/uart.py", line 389, in connect
    protocol, connection_done = await thread.run_coroutine_threadsafe(
  File "/usr/local/lib/python3.10/site-packages/bellows/uart.py", line 368, in _connect
    transport, protocol = await zigpy.serial.create_serial_connection(
  File "/usr/local/lib/python3.10/site-packages/zigpy/serial.py", line 36, in create_serial_connection
    transport, protocol = await loop.create_connection(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
    return await fut
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 535, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.1.20', 8888)

当前Xiaomi Gateway 3集成版本v2.1.2, xiaomi gateway 3集成entities中网关command远程重启小米多模网关3代(ZHA网关),然后reload ZHA集成,貌似这样就解决了问题。

再次尝试将core升级到2023.1.4版本后,xiaomi gateway3集成报错无法运行了,如下
Logger: homeassistant.setup
Source: setup.py:210
First occurred: 10:33:59 PM (1 occurrences)
Last logged: 10:33:59 PM

Setup failed for custom integration xiaomi_gateway3: Unable to import component: cannot import name 'Command' from 'zigpy.zcl.foundation' (/usr/local/lib/python3.10/site-packages/zigpy/zcl/foundation.py)

2023年1月15日晚间再次core退回到2023.1.0,Zigbee2MQTT   Current version: 1.29.2-1 ,Z2M拓扑图所有设备都显示断连,虽然现实可控但是实际不可控。只好再次尝试退回 Z2M到addon_45df7312_zigbee2mqtt_1.29.1-1
core和z2m都退回到旧版本以后,总算稳定了。看来这些软件模块追最新版本会带来稳定性和可用性的降低。不知道一直不升级软件模块,能不能让本地一直可用。Z2M和ZHA不依赖互联网应该没问题。 xiaomi miot和xiaomi gateway3这些依赖互联网的服务应该还是要升级的,要不然哪天旧版会不然不可用。

2023年1月16日 14:45:47: HA什么都没变动过,昨晚还很稳定,今天Z2M网络拓扑图里所有设备都断开网络了,ping多模网关延迟正常,不知道原因。尝试command entity重启多模网关,重启HA,都无法解决问题。最后将HA系统虚拟机重启以后才解决该问题。2023年1月16日 20:50:11,这个问题再次出现。此次依然通过HA虚拟机重启才解决问题,每次重启都有极个别zigbee设备需要重新配对才能用。考虑z2m集成继续降低版本,当前版本1.29.1-1 。
2023年1月17日:当前z2m版本1.29.0-1,还是遇到了昨天相同问题。错误提示摘录如下,以下五个设备包含一个coordinator和四个repeater,其他单火线设备没有出现在错误提示。
error 2023-01-17 17:17:41Failed to execute LQI for 'Coordinator'
error 2023-01-17 17:17:47Failed to execute LQI for '店铺厨房灯'
error 2023-01-17 17:17:54Failed to execute LQI for 'sonoff dongle'
error 2023-01-17 17:17:59Failed to execute LQI for '东边二号树灯'
error 2023-01-17 17:18:05Failed to execute LQI for '涂鸦mini usb中继器'

Z2M addon已经降级了几个版本,接下来考虑降级xiaomi gateway3集成。目前用的xiaomi gateway3集成版本是v2.1.2,现在降级为v2.1.1版本,重启HA以后z2m设备断连问题依然存在,只能再次重启虚拟机。将HA core升级到最新版本2023.1.5,gateway3集成无法加载了。考虑将gateway升级到最新的v3.0-alpha.1版本,升级后和新版core冲突问题得到了解决,但是z2m断连问题依旧。

2023年1月21日 21:45:47:最近几天升级过core,目前是core 2023.1.6版本,目前又发现Z2M所有设备断链现象,再次尝试将core降级到2023.1.5版本。降级core版本以后z2m设备还是断链
2023-01-21 22:00:57Failed to execute LQI for 'Coordinator'
error 2023-01-21 22:01:05Failed to execute LQI for '店铺厨房灯'
error 2023-01-21 22:01:09Failed to execute LQI for 'sonoff dongle'
error 2023-01-21 22:01:15Failed to execute LQI for '东边二号树灯'





回复

使用道具 举报

3

主题

29

帖子

373

积分

中级会员

Rank: 3Rank: 3

积分
373
金钱
344
HASS币
10
发表于 2023-6-5 14:00:41 | 显示全部楼层
楼主现在解决了吗
回复

使用道具 举报

45

主题

452

帖子

1641

积分

金牌会员

Rank: 6Rank: 6

积分
1641
金钱
1189
HASS币
0
发表于 2023-6-5 15:45:12 | 显示全部楼层
我才玩zigbee二周,用得也是ZHA,网关和中断已经死过一次机了,不知道问题在哪里,以前用阿里网关时,硬件上是稳定的,只是软件不好用。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-27 13:42 , Processed in 0.469143 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表