Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tapo Fails to Add Device on Will Not Authenticate to Tapo App #828

Open
woodsoftwareguy opened this issue Jan 15, 2025 · 1 comment
Open

Comments

@woodsoftwareguy
Copy link

Version of the integration

Configuration

Add your logs here.

Repeated attempt to add Tapo device and this was taken from the home-assistant.log

2025-01-14 19:09:27.658 ERROR (MainThread) [DeviceFactory] None of available protocol is working, maybe invalid credentials
2025-01-14 19:09:31.159 WARNING (MainThread) [homeassistant.components.media_player] Updating webostv media_player took longer than the scheduled update interval 0:00:10
2025-01-14 19:09:41.160 WARNING (MainThread) [homeassistant.components.media_player] Updating webostv media_player took longer than the scheduled update interval 0:00:10
2025-01-14 19:09:41.773 WARNING (MainThread) [root] No encryption schema found for discovered device 192.168.68.250 HOMEWIFISYSTEM
2025-01-14 19:09:41.923 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 316, in _async_get_device
device = await discovered_device.get_tapo_device(credential, session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/discovery/discovered_device.py", line 92, in get_tapo_device
return await connect(config, session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/new/device_factory.py", line 55, in connect
protocol = await _get_or_guess_protocol(config, session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/new/device_factory.py", line 65, in _get_or_guess_protocol
return await _guess_protocol(config, session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/new/device_factory.py", line 94, in _guess_protocol
info = await protocol.send_request(device_info_request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/protocol/passthrough_protocol.py", line 45, in send_request
response = await self._send_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/protocol/passthrough_protocol.py", line 65, in _send_request
await self._login_with_version(self._credential)
File "/usr/local/lib/python3.13/site-packages/plugp100/protocol/passthrough_protocol.py", line 84, in _login_with_version
session_or_error = await self._passthrough.handshake(self._url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/protocol/securepassthrough_transport.py", line 71, in handshake
resp_dict = await response.json(content_type=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 82, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/client_reqrep.py", line 1298, in json
return loads(stripped.decode(encoding))
File "/usr/src/homeassistant/homeassistant/util/json.py", line 42, in json_loads
return orjson.loads(obj) # type:ignore[no-any-return]
~~~~~~~~~~~~^^^^^
orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)

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 231, in async_step_discovery_auth_confirm
device = await self._async_get_device_from_discovered(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._discovered_info, user_input
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/config/custom_components/tapo/config_flow.py", line 295, in _async_get_device_from_discovered
return await self._async_get_device(config | {CONF_HOST: discovered.ip}, discovered)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tapo/config_flow.py", line 322, in _async_get_device
raise CannotConnect from error
custom_components.tapo.errors.CannotConnect
2025-01-14 19:09:48.573 ERROR (MainThread) [DeviceFactory] None of available protocol is working, maybe invalid credentials
2025-01-14 19:09:51.161 WARNING (MainThread) [homeassistant.components.media_player] Updating webostv media_player took longer than the scheduled update interval 0:00:10

##The following were from Settings Log:

This error originated from a custom integration.
Logger: DeviceFactory
Source: custom_components/tapo/hass_tapo.py:34
integration: TP-Link Tapo (documentation, issues)
First occurred: January 12, 2025 at 12:35:01 PM (3576 occurrences)
Last logged: 6:51:29 PM
None of available protocol is working, maybe invalid credentials

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:324
First occurred: 6:49:59 PM (1 occurrences)
Last logged: 6:49:59 PM

Detected that custom integration 'tapo' sets option flow config_entry explicitly, which is deprecated at custom_components/tapo/config_flow.py, line 335: self.config_entry = config_entry. This will stop working in Home Assistant 2025.12, please create a bug report at https://github.com/petretiandrea/home-assistant-tapo-p100/issues

Logger: DeviceFactory
Source: custom_components/tapo/hass_tapo.py:34
integration: TP-Link Tapo (documentation, issues)
First occurred: January 12, 2025 at 12:35:01 PM (3576 occurrences)
Last logged: 6:51:29 PM

None of available protocol is working, maybe invalid credentials

Describe the bug

A clear and concise description of what the bug is.

Debug log

This error originated from a custom integration.

Logger: custom_components.tapo.config_flow
Source: custom_components/tapo/config_flow.py:231
integration: TP-Link Tapo (documentation, issues)
First occurred: January 5, 2025 at 4:02:09 PM (7 occurrences)
Last logged: 10:29:05 PM

Failed to setup cannot connect
Traceback (most recent call last):
File "/config/custom_components/tapo/config_flow.py", line 316, in _async_get_device
device = await discovered_device.get_tapo_device(credential, session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/discovery/discovered_device.py", line 92, in get_tapo_device
return await connect(config, session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/new/device_factory.py", line 55, in connect
protocol = await _get_or_guess_protocol(config, session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/new/device_factory.py", line 65, in _get_or_guess_protocol
return await _guess_protocol(config, session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/new/device_factory.py", line 94, in _guess_protocol
info = await protocol.send_request(device_info_request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/protocol/passthrough_protocol.py", line 45, in send_request
response = await self._send_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/protocol/passthrough_protocol.py", line 65, in _send_request
await self._login_with_version(self._credential)
File "/usr/local/lib/python3.13/site-packages/plugp100/protocol/passthrough_protocol.py", line 84, in _login_with_version
session_or_error = await self._passthrough.handshake(self._url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/plugp100/protocol/securepassthrough_transport.py", line 71, in handshake
resp_dict = await response.json(content_type=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 82, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/client_reqrep.py", line 1298, in json
return loads(stripped.decode(encoding))
File "/usr/src/homeassistant/homeassistant/util/json.py", line 42, in json_loads
return orjson.loads(obj) # type:ignore[no-any-return]
~~~~~~~~~~~~^^^^^
orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)

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 231, in async_step_discovery_auth_confirm
device = await self._async_get_device_from_discovered(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._discovered_info, user_input
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/config/custom_components/tapo/config_flow.py", line 295, in _async_get_device_from_discovered
return await self._async_get_device(config | {CONF_HOST: discovered.ip}, discovered)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tapo/config_flow.py", line 322, in _async_get_device
raise CannotConnect from error
custom_components.tapo.errors.CannotConnect

@Paul1865
Copy link

Same here. It's a mess now. Automations don't work any more and old devices are added as new, but cant be added (in add-panel I get the error 'failed to connect').

Also 2025-01-18 09:21:13.408 ERROR (MainThread) [custom_components.tapo.coordinators] Error fetching tapo data: Unexpected exception: <TapoError.ERR_CLOUD_FAILED: -1007>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants