petretiandrea / home-assistant-tapo-p100

A custom integration to control Tapo devices from home assistant.
MIT License
804 stars 100 forks source link

Error 1003 when adding L530 bulb #795

Open rmail2006 opened 1 month ago

rmail2006 commented 1 month ago

Version of the integration

v3.1.4 (v3.1.2 noted on the integration page) <- not sure if this is another issue where it's not stating the version number downloaded?

Configuration

Tapo L530 Series
Hardware: 1.0
Firmware: 1.3.1 Build 20240630 Rel. 64117

Describe the bug

Since updating my bulb (Bedroom Light), it will no longer connect to my home assistant. I've had this bulb for around 6-8 months with no issue.

I've updated my home assistant (core etc) just to be safe, but no luck, it is still not working. It seems to be throwing a 1003 error.

I've removed the bulb from HASS and tried adding it, but get the same error. I've removed the bulb from HASS and Tapo, reconnected the bulb to both, but I still get the error. The bulb still works fine via the Tapo app.

I've tried accessing the bulb via my browser (192.168.0.28:80) and it gives me the following JSON response:

{
    "error_code": 1003
}

When doing the same to other bulbs, I get a 200 OK response (blank screen).

Edit: I've check all my bulbs and this is the only bulb I have that is hardware version 1.0 on latest firmware. My other bulb on HW 1.0 is firmware 1.3.0 so I'll not update as of yet.

My other bulbs are on HW 2.0 and latest firmware (1.1.1 240623) and still work fine.

Debug log


Logger: custom_components.tapo.config_flow
Source: custom_components/tapo/config_flow.py:231
integration: TP-Link Tapo ([documentation](https://github.com/petretiandrea/home-assistant-tapo-p100), [issues](https://github.com/petretiandrea/home-assistant-tapo-p100/issues))
First occurred: 00:14:57 (3 occurrences)
Last logged: 10:28:29

Failed to setup cannot connect
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 71, in send_request
    if response := await self._send_request(request, retry):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 84, in _send_request
    self._klap_session = await self.perform_handshake()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 122, in perform_handshake
    if seeds := await self.perform_handshake1():
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 207, in perform_handshake1
    raise Exception(
Exception: Server response doesn't match our challenge on url http://192.168.0.28:80/app

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 71, in send_request
    if response := await self._send_request(request, retry):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 84, in _send_request
    self._klap_session = await self.perform_handshake()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 122, in perform_handshake
    if seeds := await self.perform_handshake1():
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 207, in perform_handshake1
    raise Exception(
Exception: Server response doesn't match our challenge on url http://192.168.0.28:80/app

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 71, in send_request
    if response := await self._send_request(request, retry):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 84, in _send_request
    self._klap_session = await self.perform_handshake()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 122, in perform_handshake
    if seeds := await self.perform_handshake1():
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 207, in perform_handshake1
    raise Exception(
Exception: Server response doesn't match our challenge on url http://192.168.0.28:80/app

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/tapo/config_flow.py", line 317, in _async_get_device
    await device.update()
  File "/usr/local/lib/python3.12/site-packages/plugp100/new/tapodevice.py", line 60, in update
    components = await self._negotiate_components()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/new/tapodevice.py", line 183, in _negotiate_components
    return (await self.client.get_component_negotiation()).get_or_raise()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/common/functional/tri.py", line 159, in get_or_raise
    raise self.value
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 71, in send_request
    if response := await self._send_request(request, retry):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 84, in _send_request
    self._klap_session = await self.perform_handshake()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 122, in perform_handshake
    if seeds := await self.perform_handshake1():
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/protocol/klap/klap_protocol.py", line 207, in perform_handshake1
    raise Exception(
Exception: Server response doesn't match our challenge on url http://192.168.0.28:80/app

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(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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
mmaritz commented 3 weeks ago

I have same issue with existing L530 - this is error in integration. image

rmail2006 commented 3 weeks ago

I eventually got my bulb added but it was using another integration. I'm not trying to push people that way, but hopefully it will suffice until a fix is put in place on this repo. https://www.home-assistant.io/integrations/tplink

I only have my affected bulb added via this other integration, everything else uses this one :)