Aohzan / ipx800

IPX800 V4 integration for Home-Assistant
Apache License 2.0
20 stars 12 forks source link

Timeout API #33

Closed boutXIII closed 1 year ago

boutXIII commented 1 year ago
2022-09-28 21:13:04.248 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ipx800v4 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
2022-09-28 21:13:04.249 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration browser_mod 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
2022-09-28 21:13:04.266 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ui_lovelace_minimalist 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
2022-09-28 21:13:18.439 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:13:57.002 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:14:37.002 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:15:55.002 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:19:23.001 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:20:16.529 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140243427084464] Timeout occurred while connecting to IPX800.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pypx800/ipx800.py", line 61, in request_api
    response = await self._session.get(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  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
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pypx800/ipx800.py", line 60, in request_api
    with async_timeout.timeout(self._request_timeout):
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 116, in __exit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 535, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/config/custom_components/ipx800v4/light.py", line 106, in async_turn_on
    await self.control.on()
  File "/usr/local/lib/python3.10/site-packages/pypx800/relay.py", line 28, in on
    await self._ipx.request_api(params)
  File "/usr/local/lib/python3.10/site-packages/pypx800/ipx800.py", line 81, in request_api
    raise Ipx800CannotConnectError(
pypx800.exceptions.Ipx800CannotConnectError: Timeout occurred while connecting to IPX800.
2022-09-28 21:20:21.529 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140243427084464] Timeout occurred while connecting to IPX800.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pypx800/ipx800.py", line 61, in request_api
    response = await self._session.get(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  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
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pypx800/ipx800.py", line 60, in request_api
    with async_timeout.timeout(self._request_timeout):
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 116, in __exit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 535, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/config/custom_components/ipx800v4/light.py", line 106, in async_turn_on
    await self.control.on()
  File "/usr/local/lib/python3.10/site-packages/pypx800/relay.py", line 28, in on
    await self._ipx.request_api(params)
  File "/usr/local/lib/python3.10/site-packages/pypx800/ipx800.py", line 81, in request_api
    raise Ipx800CannotConnectError(
pypx800.exceptions.Ipx800CannotConnectError: Timeout occurred while connecting to IPX800.
2022-09-28 21:20:23.003 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:21:26.001 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:22:51.002 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:23:31.002 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:24:44.002 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
2022-09-28 21:25:36.002 ERROR (MainThread) [custom_components.ipx800v4] Error fetching ipx800v4 data: Failed to communicating with API: Timeout occurred while connecting to IPX800.
Aohzan commented 1 year ago

Home-Assistant n'arrive pas à joindre l'IPX

boutXIII commented 1 year ago

Oui je m'en suis douter, mais par contre le plus bizarre c'est que rien n'a changer et cela arrive ponctuellement

Aohzan commented 1 year ago

Le V4 n'est pas très robuste niveau performance et s'il a trop de requêtes au même moment il ne répond pas toujours...