banto6 / haier

海尔智能家居设备接入HomeAssistant
Apache License 2.0
589 stars 121 forks source link

每隔一到两天就会失效, 需要重新载入 #95

Closed Jay-HomeAssistant closed 6 months ago

Jay-HomeAssistant commented 6 months ago

问题描述 请教下,我遇到的问题是大约每隔一到两天就会显示“设置失败”,如附图,需要手动做重新载入才能继续正常使用. 非常感谢! 屏幕截图 2024-03-27 233156

环境信息:

设备信息 -应该与设备无关; 我的设备是海尔KN3热水器,有设定HA的自动化利用实体开关去控制零冷水的开关

以下信息开启debug模式后可在Device Info部分的日志中找到。日志可在配置 > 系统 > 日志 > 加载完整日志中查看。

deviceType:
productCodeT:
productNameT:
wifiType:

错误日志 Logger: homeassistant.config_entries Source: config_entries.py:402 First occurred: 18:29:01 (1 occurrences) Last logged: 18:29:01

Error setting up entry Haier: for haier Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1112, in create_connection transport, protocol = await self._create_connection_transport( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1145, in _create_connection_transport await waiter File "/usr/local/lib/python3.11/asyncio/sslproto.py", line 575, in _on_handshake_complete raise handshake_exc ConnectionResetError

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 402, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/haier/init.py", line 62, in async_setup_entry devices = await get_available_devices(client) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/haier/init.py", line 133, in get_available_devices devices = await client.get_devices() + await get_virtual_devices(client) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/haier/core/client.py", line 118, in get_devices async with http_client.get(url=GET_DEVICES_API, headers=headers) as response: File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1209, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1178, in _create_direct_connection transp, proto = await self._wrap_create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host uws.haier.net:443 ssl:default [None]

屏幕截图 2024-03-27 234155

Jay-HomeAssistant commented 6 months ago

抱歉刚刚才开启调试模式,我再等它失效后将log上传,谢谢

如下为开启调试模式后的日志,还麻烦帮看下是什么原因,多谢了。我记得以前是没有这个问题的 `2024-03-28 10:30:02.918 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration xiaomi_miot which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-03-28 10:30:02.931 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration midea_ac_lan which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-03-28 10:30:02.943 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration bemfa which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-03-28 10:30:02.947 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration haier which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-03-28 10:30:02.959 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-03-28 10:30:15.170 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly 2024-03-28 10:30:15.956 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=146 from 2024-03-27 22:29:33.551155) 2024-03-28 10:30:30.597 DEBUG (MainThread) [custom_components.haier] 已从HomeAssistant加载到缓存的token 2024-03-28 10:30:32.046 ERROR (MainThread) [metno] Access to https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/2.0/complete returned error 'ClientConnectorError' 2024-03-28 10:30:36.794 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Haier: 186xxxxxxxx for haier Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1112, in create_connection transport, protocol = await self._create_connection_transport( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1145, in _create_connection_transport await waiter File "/usr/local/lib/python3.11/asyncio/sslproto.py", line 575, in _on_handshake_complete raise handshake_exc ConnectionResetError

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 402, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/haier/init.py", line 62, in async_setup_entry devices = await get_available_devices(client) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/haier/init.py", line 133, in get_available_devices devices = await client.get_devices() + await get_virtual_devices(client) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/haier/core/client.py", line 118, in get_devices async with http_client.get(url=GET_DEVICES_API, headers=headers) as response: File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1209, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1178, in _create_direct_connection transp, proto = await self._wrap_create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host uws.haier.net:443 ssl:default [None] 2024-03-28 10:30:46.925 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.11/site-packages/tzlocal/unix.py:193: UserWarning: Can not find any timezone configuration, defaulting to UTC. warnings.warn("Can not find any timezone configuration, defaulting to UTC.") `

banto6 commented 6 months ago

_aiohttp.clientexceptions.ClientConnectorError: Cannot connect to host uws.haier.net:443 ssl:default [None]

网络问题,没办法访问uws.haier.net,检查一下网络环境