home-assistant-tapo-p100 icon indicating copy to clipboard operation
home-assistant-tapo-p100 copied to clipboard

cannot connect h200

Open raoul170 opened this issue 1 year ago • 81 comments

Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.tapo.config_flow Source: custom_components/tapo/config_flow.py:118 Integration: TP-Link Tapo (documentation, issues) First occurred: 16:39:26 (1 occurrences) Last logged: 16:39:26

Failed to setup cannot connect 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 1085, in create_connection raise exceptions[0] File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect return await fut ^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') TimeoutError: [Errno 110] Connect call failed ('193.168.178.241', 80)

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

Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 215, in _try_setup_api await client.initialize() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 62, in initialize await self._guess_protocol() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 218, in _guess_protocol response = await self.execute_raw_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request return (await self._protocol.send_request(request)).map(lambda x: x.result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request response = await self._send_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request await self._login_with_version(self._credential) File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version session_or_error = await self._passthrough.handshake(self._url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake response = await self._http.async_make_post(url, json=request_body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post async with self.session.post( 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 _create_connection _, 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 193.168.178.241:80 ssl:default [Connect call failed ('193.168.178.241', 80)]

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

Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 118, in async_step_user tapo_client = await self._try_setup_api(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/config_flow.py", line 220, in _try_setup_api raise CannotConnect from error custom_components.tapo.errors.CannotConnect

raoul170 avatar Oct 17 '23 14:10 raoul170

Same problem with me.

"Unknown error occurred" when trying to add h200.

H200 hub connects successfully through Tapo camera control integration.

antstyl avatar Oct 17 '23 18:10 antstyl

H200 won't connect for me, Error message: "Failed to connect"

2023-10-20 19:33:06.876 ERROR (MainThread) [custom_components.tapo.config_flow] Failed to setup cannot connect Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 211, in _try_setup_api host, port = get_host_port(user_input[CONF_HOST]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/setup_helpers.py", line 131, in get_host_port return (parts[0], int(parts[1])) ^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '62:8b:0a:23:7f'

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

Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 118, in async_step_user tapo_client = await self._try_setup_api(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/config_flow.py", line 220, in _try_setup_api raise CannotConnect from error custom_components.tapo.errors.CannotConnect

pektommy avatar Oct 18 '23 05:10 pektommy

I got the following from debugging:

`2023-10-19 11:37:52.550 ERROR (MainThread) [custom_components.tapo.coordinators] Error fetching tapo data: Unexpected exception:

2023-10-19 11:48:12.550 ERROR (MainThread) [custom_components.tapo.coordinators] Error fetching tapo data: Unexpected exception:

2023-10-19 11:56:12.575 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.027 seconds (success: True)

2023-10-19 11:56:14.057 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.334 seconds (success: True)

2023-10-19 11:56:32.960 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.028 seconds (success: True)

2023-10-19 11:56:36.638 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.029 seconds (success: True)

2023-10-19 11:56:36.774 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.032 seconds (success: True)

2023-10-19 11:56:42.578 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.029 seconds (success: True)

2023-10-19 11:56:43.761 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.038 seconds (success: True)

2023-10-19 11:57:02.972 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.038 seconds (success: True)

2023-10-19 11:57:06.648 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.039 seconds (success: True)

2023-10-19 11:57:06.772 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.031 seconds (success: True)

2023-10-19 11:57:12.577 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.029 seconds (success: True)

2023-10-19 11:57:13.761 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.038 seconds (success: True)

2023-10-19 11:57:32.971 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.038 seconds (success: True)

2023-10-19 11:57:36.646 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.037 seconds (success: True)

2023-10-19 11:57:36.771 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.029 seconds (success: True)

2023-10-19 11:57:43.762 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.039 seconds (success: True)

2023-10-19 11:57:52.551 ERROR (MainThread) [custom_components.tapo.coordinators] Error fetching tapo data: Unexpected exception:

2023-10-19 11:57:52.551 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 10.001 seconds (success: False)

2023-10-19 11:58:02.971 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.039 seconds (success: True)

2023-10-19 11:58:06.655 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.046 seconds (success: True)

2023-10-19 11:58:06.779 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.038 seconds (success: True)`

antstyl avatar Oct 19 '23 09:10 antstyl

H200 non si connette per me, messaggio di errore: "Impossibile connettersi"

Same problem.

xFranklin7 avatar Oct 20 '23 10:10 xFranklin7

H200 non si connette per me, messaggio di errore: "Impossibile connettersi"

Same problem.

Has anyone managed to connect? :)

pektommy avatar Oct 20 '23 17:10 pektommy

62:8b:0a:23:7f

Why are you using something like mac address as host?

petretiandrea avatar Oct 28 '23 10:10 petretiandrea

'193.168.178.241'

Is this a local ip address '193.168.178.241'?

petretiandrea avatar Oct 28 '23 10:10 petretiandrea

This is my log.

2023-10-28 12:43:15.608 ERROR (MainThread) [custom_components.tapo.config_flow] Failed to setup cannot connect 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 1085, in create_connection raise exceptions[0] File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect return await fut ^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') TimeoutError: [Errno 110] Connect call failed ('192.168.1.18', 80)

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

Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 215, in _try_setup_api await client.initialize() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 62, in initialize await self._guess_protocol() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 218, in _guess_protocol response = await self.execute_raw_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request return (await self._protocol.send_request(request)).map(lambda x: x.result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request response = await self._send_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request await self._login_with_version(self._credential) File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version session_or_error = await self._passthrough.handshake(self._url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake response = await self._http.async_make_post(url, json=request_body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post async with self.session.post( 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 _create_connection _, 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 192.168.1.18:80 ssl:default [Connect call failed ('192.168.1.18', 80)]

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

Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 118, in async_step_user tapo_client = await self._try_setup_api(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/config_flow.py", line 220, in _try_setup_api raise CannotConnect from error custom_components.tapo.errors.CannotConnect

xFranklin7 avatar Oct 28 '23 11:10 xFranklin7

'193.168.178.241'

Is this a local ip address '193.168.178.241'?

yes local

raoul170 avatar Oct 28 '23 12:10 raoul170

same error

Deze fout is ontstaan door een aangepaste integratie. Logger: custom_components.tapo.config_flow Source: custom_components/tapo/config_flow.py:118 Integration: TP-Link Tapo (documentation, issues) First occurred: 21:09:37 (1 occurrences) Last logged: 21:09:37

Failed to setup cannot connect 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 1085, in create_connection raise exceptions[0] File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect return await fut ^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') TimeoutError: [Errno 110] Connect call failed ('192.168.10.70', 80)

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

Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 215, in _try_setup_api await client.initialize() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 62, in initialize await self._guess_protocol() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 218, in _guess_protocol response = await self.execute_raw_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request return (await self._protocol.send_request(request)).map(lambda x: x.result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request response = await self._send_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request await self._login_with_version(self._credential) File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version session_or_error = await self._passthrough.handshake(self._url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake response = await self._http.async_make_post(url, json=request_body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post async with self.session.post( 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 _create_connection _, 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 192.168.10.70:80 ssl:default [Connect call failed ('192.168.10.70', 80)]

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

Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 118, in async_step_user tapo_client = await self._try_setup_api(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/config_flow.py", line 220, in _try_setup_api raise CannotConnect from error custom_components.tapo.errors.CannotConnect

johannijs avatar Nov 02 '23 20:11 johannijs

Same for me so far the H200 can not connect. H200 firmware : 1.2.23 home-assistant-p100 : 2.11 HomeAssistant : 2023.11.0

DennisdeBest avatar Nov 13 '23 16:11 DennisdeBest

same here. It tries to connect 80 port, but camera 80 port is closed. 443 is open

junyan-rippling avatar Nov 13 '23 16:11 junyan-rippling

Same here

H200 firmware : 1.2.23 home-assistant-p100 : 2.11 Core : 2023.11.2 Supervisor: 2023.11.3 OS 11.1

Nothing new to add !, same errors :(

aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.50.21:80 ssl:default [Connect call failed ('192.168.50.21', 80)]

not that i know why it's an ... :80 ssl:default

PS: Lately Tapo have push out updates, with "improved security", The Tapo-Camera-Control by JurajNyiri , has been busy keeping up with "patches/fixes" , maybe this is caused by the same, as Tapo both updated their App, and the H200 resently

1.2.23 Build 20231012 rel.49638

EDIT:

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 192.168.50.21:80 ssl:default [Connect call failed ('192.168.50.21', 80)] The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 118, in async_step_user tapo_client = await self._try_setup_api(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/config_flow.py", line 220, in _try_setup_api raise CannotConnect from error

Currently trying to DEBUG , but there seems to be nothing to DEBUG ... Below is all there is,

2023-11-16 18:45:58.315 ERROR (MainThread) [custom_components.tapo.config_flow] Failed to setup cannot connect 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 1085, in create_connection raise exceptions[0] File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect return await fut ^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') TimeoutError: [Errno 110] Connect call failed ('192.168.50.21', 80) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 215, in _try_setup_api await client.initialize() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 62, in initialize await self._guess_protocol() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 235, in _guess_protocol response = await self.execute_raw_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request return (await self._protocol.send_request(request)).map(lambda x: x.result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request response = await self._send_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request await self._login_with_version(self._credential) File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version session_or_error = await self._passthrough.handshake(self._url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake response = await self._http.async_make_post(url, json=request_body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post async with self.session.post( 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 _create_connection _, 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 192.168.50.21:80 ssl:default [Connect call failed ('192.168.50.21', 80)] The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 118, in async_step_user tapo_client = await self._try_setup_api(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/config_flow.py", line 220, in _try_setup_api raise CannotConnect from error custom_components.tapo.errors.CannotConnect

I'll try with "custom_components.tapo.config_flow"

boheme61 avatar Nov 16 '23 16:11 boheme61

Tapo has released a new authentication flow recently. It is advertised as encrypt_type: 3. In short, they turned to using a challenge response protocol to address security issues. Context here:

https://docs.google.com/presentation/d/1zdG803ZWzpvpM0LFUE-MU2lusrOALOAaroGsQ9dj42Y/edit#slide=id.p

irsl avatar Nov 18 '23 09:11 irsl

Hi guys, to fix issue with h200 I need someone runs this python script, and report here the output

import asyncio
import os

from plugp100.api.hub.hub_device import HubDevice
from plugp100.api.light_effect_preset import LightEffectPreset
from plugp100.api.tapo_client import TapoClient
from plugp100.common.credentials import AuthCredential


async def main():
    # create generic tapo api
    username = os.getenv("USERNAME", "<tapo_email>")
    password = os.getenv("PASSWORD", "<tapo_password>")

    credentials = AuthCredential(username, password)
    client = TapoClient(credentials, "<tapo_device_ip>")

    print(await client.get_device_info())
    print(await client.get_child_device_list())
    print(await client.get_child_device_component_list())


if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())
    loop.run_until_complete(asyncio.sleep(0.1))
    loop.close()

petretiandrea avatar Nov 18 '23 09:11 petretiandrea

Hi, I can help but not sure where to save this script on HA and how to run it? I have an H200 and HA installed with terminal access.

hiltonhowie avatar Nov 18 '23 10:11 hiltonhowie

I can " join in " but as you , i have no idea what and howto :)

prepared by adding in config.yaml


logger:
  default: info
  logs:
     custom_components.tapo: debug

debugpy:
  start: true
  wait: false

ohh-well , with right indentations ofcause

@hiltonhowie

save it as " something.py " and copy it to /custom_components/tapo

boheme61 avatar Nov 18 '23 11:11 boheme61

You must create a python file, like main.py and then run python main.py. You can run It on same HA machine

petretiandrea avatar Nov 18 '23 12:11 petretiandrea

dont know how to "make it run in studio-code-s , does it work to run in terminal ?

➜  /config cd custom_components/tapo
➜  tapo python tapodebug.py
Traceback (most recent call last):
  File "/homeassistant/custom_components/tapo/tapodebug.py", line 4, in <module>
    from plugp100.api.hub.hub_device import HubDevice
ModuleNotFoundError: No module named 'plugp100'

do i have to "initiate" the setup of H200 , and then run python fil.py ?

boheme61 avatar Nov 18 '23 12:11 boheme61

hmmm wait, am i in the wrong "issue" here ? , i thought this was about to setup H200 in the integration

Not about ... LightEffectPreset

It's the H200 which will not "integrate", cannot connect to ...:80 ssl:default (Ip of the HUB itself)

This happens during setup of the H200, as atleast 5 of above having issues with, after filling in info and clicking submit, it just "spins" until abort and final errors

PS: I think yo got "deceived " by post 3 , as all other seems to have issues connecting H200

EDIT: I can add the H200 in Tapo_camera_controller but immediately get errors , most likely do to the fact i don't have any Cams in this Hub

boheme61 avatar Nov 18 '23 12:11 boheme61

On my HA Yellow.

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 634, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 674, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
TimeoutError: [Errno 110] Connect call failed ('192.168.88.77', 80)

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

Traceback (most recent call last):
  File "/root/gh_test.py", line 26, in <module>
    loop.run_until_complete(main())
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/root/gh_test.py", line 17, in main
    await client.initialize()
  File "/usr/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 62, in initialize
    await self._guess_protocol()
  File "/usr/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 235, in _guess_protocol
    response = await self.execute_raw_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request
    return (await self._protocol.send_request(request)).map(lambda x: x.result)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request
    response = await self._send_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request
    await self._login_with_version(self._credential)
  File "/usr/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version
    session_or_error = await self._passthrough.handshake(self._url)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake
    response = await self._http.async_make_post(url, json=request_body)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post
    async with self.session.post(
  File "/usr/lib/python3.11/site-packages/aiohttp/client.py", line 1187, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aiohttp/client.py", line 574, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aiohttp/connector.py", line 1231, in _create_direct_connection
    raise last_exc
  File "/usr/lib/python3.11/site-packages/aiohttp/connector.py", line 1200, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aiohttp/connector.py", line 996, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.88.77:80 ssl:default [Connect call failed ('192.168.88.77', 80)]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fb9d47350>

AshleyJackson avatar Nov 19 '23 06:11 AshleyJackson

dont know how to "make it run in studio-code-s , does it work to run in terminal ?

➜  /config cd custom_components/tapo
➜  tapo python tapodebug.py
Traceback (most recent call last):
  File "/homeassistant/custom_components/tapo/tapodebug.py", line 4, in <module>
    from plugp100.api.hub.hub_device import HubDevice
ModuleNotFoundError: No module named 'plugp100'

do i have to "initiate" the setup of H200 , and then run python fil.py ?

Install plugp100 by pip install plugp100

petretiandrea avatar Nov 19 '23 09:11 petretiandrea

Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 988, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection raise exceptions[0] File "/usr/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock await self.sock_connect(sock, address) File "/usr/lib/python3.11/asyncio/selector_events.py", line 634, in sock_connect return await fut ^^^^^^^^^ File "/usr/lib/python3.11/asyncio/selector_events.py", line 674, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') TimeoutError: [Errno 110] Connect call failed ('192.168.10.70', 80)

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

Traceback (most recent call last): File "/homeassistant/tapo.py", line 26, in loop.run_until_complete(main()) File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/homeassistant/tapo.py", line 17, in main await client.initialize() File "/usr/local/lib/python3.11/dist-packages/plugp100/api/tapo_client.py", line 62, in initialize await self._guess_protocol() File "/usr/local/lib/python3.11/dist-packages/plugp100/api/tapo_client.py", line 235, in _guess_protocol response = await self.execute_raw_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request return (await self._protocol.send_request(request)).map(lambda x: x.result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request response = await self._send_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request await self._login_with_version(self._credential) File "/usr/local/lib/python3.11/dist-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version session_or_error = await self._passthrough.handshake(self._url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake response = await self._http.async_make_post(url, json=request_body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post async with self.session.post( File "/usr/local/lib/python3.11/dist-packages/aiohttp/client.py", line 1187, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/aiohttp/client.py", line 574, in _request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 540, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 907, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 1231, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 1200, in _create_direct_connection transp, proto = await self._wrap_create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 996, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.10.70:80 ssl:default [Connect call failed ('192.168.10.70', 80)] Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f1aefe02810>

johannijs avatar Nov 19 '23 10:11 johannijs

Got it

➜  tapo python main.py      
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 1169, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 880, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name or service not known

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

Traceback (most recent call last):
  File "/homeassistant/custom_components/tapo/main.py", line 26, in <module>
    loop.run_until_complete(main())
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/homeassistant/custom_components/tapo/main.py", line 17, in main
    await client.initialize()
  File "/usr/local/lib/python3.11/dist-packages/plugp100/api/tapo_client.py", line 62, in initialize
    await self._guess_protocol()
  File "/usr/local/lib/python3.11/dist-packages/plugp100/api/tapo_client.py", line 235, in _guess_protocol
    response = await self.execute_raw_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request
    return (await self._protocol.send_request(request)).map(lambda x: x.result)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request
    response = await self._send_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request
    await self._login_with_version(self._credential)
  File "/usr/local/lib/python3.11/dist-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version
    session_or_error = await self._passthrough.handshake(self._url)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake
    response = await self._http.async_make_post(url, json=request_body)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post
    async with self.session.post(
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/client.py", line 1187, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/client.py", line 574, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/connector.py", line 1183, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host <tapo_device_ip>:80 ssl:default [Name or service not known]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fcd7c7ea590>

Above is before trying to add the Hub

boheme61 avatar Nov 19 '23 15:11 boheme61

PS: i run HA "internal" (http), no https-portforwarding-or reverse-proxy or the likes

And the hub is working, over the android-tapo-app, and added as a device-tracker in asus.integration

boheme61 avatar Nov 19 '23 16:11 boheme61

And this is the trace from trying to setup Hub using host-name, instead of IP

EDIT: when using hostname, the "process" is "done" within few seconds, and the "trace" is thrown ... when using ip, it takes a minute or so, before it "abort" and throw the "trace"

Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1155, in _create_direct_connection hosts = await asyncio.shield(host_resolved) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 874, in _resolve_host addrs = await self._resolver.resolve(host, port, family=self._family) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/resolver.py", line 33, in resolve infos = await self._loop.getaddrinfo( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo return await self.run_in_executor( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socket.gaierror: [Errno -5] Name has no usable address The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 215, in _try_setup_api await client.initialize() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 62, in initialize await self._guess_protocol() File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 218, in _guess_protocol response = await self.execute_raw_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request return (await self._protocol.send_request(request)).map(lambda x: x.result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request response = await self._send_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request await self._login_with_version(self._credential) File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version session_or_error = await self._passthrough.handshake(self._url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake response = await self._http.async_make_post(url, json=request_body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post async with self.session.post( 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 _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1169, in _create_direct_connection raise ClientConnectorError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host h200:80 ssl:default [Name has no usable address] The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/tapo/config_flow.py", line 118, in async_step_user tapo_client = await self._try_setup_api(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/config_flow.py", line 220, in _try_setup_api raise CannotConnect from error custom_components.tapo.errors.CannotConnect

boheme61 avatar Nov 19 '23 16:11 boheme61

Here is the trace from trying to setup with IP

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 1085, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect
return await fut
^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
TimeoutError: [Errno 110] Connect call failed ('192.168.50.21', 80)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/tapo/config_flow.py", line 215, in _try_setup_api
await client.initialize()
File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 62, in initialize
await self._guess_protocol()
File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 218, in _guess_protocol
response = await self.execute_raw_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 71, in execute_raw_request
return (await self._protocol.send_request(request)).map(lambda x: x.result)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 42, in send_request
response = await self._send_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 62, in _send_request
await self._login_with_version(self._credential)
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/passthrough_protocol.py", line 81, in _login_with_version
session_or_error = await self._passthrough.handshake(self._url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/securepassthrough_transport.py", line 70, in handshake
response = await self._http.async_make_post(url, json=request_body)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/common/utils/http_client.py", line 18, in async_make_post
async with self.session.post(
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 _create_connection
_, 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 192.168.50.21:80 ssl:default [Connect call failed ('192.168.50.21', 80)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/tapo/config_flow.py", line 118, in async_step_user
tapo_client = await self._try_setup_api(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tapo/config_flow.py", line 220, in _try_setup_api
raise CannotConnect from error
custom_components.tapo.errors.CannotConnect

boheme61 avatar Nov 19 '23 16:11 boheme61

First i should say, i have no deep knowledge in either HA, or this integration, but i have seen quite alot "issues" lately related to "network/resolve" , and also know there past months has been "some" remodeling at the OS and Supervisor level, in regards to HA's Network manager etc. ... I obviously have no idea whether this can be related, just thought i would mention it , examples below is related to the HA-Host it self, i believe https://github.com/home-assistant/supervisor/pull/4476 https://github.com/home-assistant/operating-system/pull/2763/commits

But i noticed in "tapo-hub.py"

49            config_entry_id=self.entry.entry_id,
50            connections={(device_registry.CONNECTION_NETWORK_MAC, device_info.mac)}

MAC seems no longer being used in the ./storage/core.device_registry ( Maybe Host-Name is used now ) ... which is a pity, i try my best to use IP and/or MAC-binding to avoid mdns/dns as much as possible

Again, i have no idea how this "inferno" of HA and integrations/add-ons works ... but i like it :)

boheme61 avatar Nov 19 '23 19:11 boheme61

I have a similar output to boheme61 and its trying to connect on port 80. I can confirm a port check to the H200 shows a result of not listening on port 80. It is listening on port 443

1

hiltonhowie avatar Nov 19 '23 20:11 hiltonhowie

yeah , i also had this in my mind, but i couldn't figure out how to "listen", i tried with wireshark, but had no idea howto, and didn't know howto "remote sniffing" HA as im running in VMware on Debian, So if you have a good(easy to understand) tutorial to recommend, id be happy ... well i didn't try hard trying to figure it out, i been readin Changelogs and pull-requests instead : ))

boheme61 avatar Nov 19 '23 20:11 boheme61