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

Adding Tapo P115 fails with Server response doesn't match our challenge #133164

Open
p4cketw0lf opened this issue Dec 13, 2024 · 18 comments
Open

Comments

@p4cketw0lf
Copy link

The problem

Receiving an error when attempting to add P115 Plug. I have other models working fine.

Invalid authentication: Server response doesn't match our challenge on ip

This issue has the same error as #132526 which was opened for cameras.

  1. Using known good cloud auth username/password
  2. Have enabled the new button in the tapo app settings > tapo lab > third party compatibility (this is a new setting but did not work before setting was introduced either).

DEBUG

2024-12-13 11:00:44.424 DEBUG (MainThread) [kasa.transports.klaptransport] Created KLAP transport for 192.168.1.106
2024-12-13 11:00:44.424 DEBUG (MainThread) [kasa.device] Initializing 192.168.1.106 of type <class 'kasa.smart.smartdevice.SmartDevice'>
2024-12-13 11:00:44.424 DEBUG (MainThread) [kasa.protocols.smartprotocol] 192.168.1.106 multi-request-batch-1-of-1 >> '{"method":"multipleRequest","request_time_milis":1734109244424,"terminal_uuid":"g/7aEgm3BWcoDZRl4+pErg==","params":{"requests":[{"method":"component_nego"},{"method":"get_device_info"},{"method":"get_connect_cloud_state"}]}}'
2024-12-13 11:00:44.424 DEBUG (MainThread) [kasa.transports.klaptransport] Starting handshake with 192.168.1.106
2024-12-13 11:00:44.424 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.1.106/app/handshake1
2024-12-13 11:00:44.456 DEBUG (MainThread) [kasa.transports.klaptransport] Handshake1 posted at 2024-12-13 11:00:44.456285. Host is 192.168.1.106, Response status is 200, Request was 0c71cca8f5cf1902074b1ba42f51048b
2024-12-13 11:00:44.456 DEBUG (MainThread) [kasa.transports.klaptransport] Handshake1 success at 2024-12-13 11:00:44.456397. Host is 192.168.1.106, Server remote_seed is: xxx, server hash is: xxx
2024-12-13 11:00:44.456 DEBUG (MainThread) [kasa.transports.klaptransport] Server response doesn't match our challenge on ip 192.168.1.106
2024-12-13 11:00:44.456 DEBUG (MainThread) [kasa.protocols.smartprotocol] Unable to authenticate with 192.168.1.106, not retrying: Server response doesn't match our challenge on ip 192.168.1.106

What version of Home Assistant Core has the issue?

core-2024.12.2

What was the last working version of Home Assistant Core?

core-2024.12.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

tplink

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tplink/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @rytilahti, @bdraco, @sdb9696, mind taking a look at this issue as it has been labeled with an integration (tplink) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of tplink can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign tplink Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tplink documentation
tplink source
(message by IssueLinks)

@sdb9696
Copy link
Contributor

sdb9696 commented Dec 13, 2024

Could you post more logs including the earlier log message which includes DISCOVERY.

@dhilltx
Copy link

dhilltx commented Dec 13, 2024

I'm receiving the same error message when trying to setup a new P115 plug using the updated Tapo app with third party compatibility enabled.

I have multiple working TP-Link Kasa plugs but this is my first TP-Link Tapo plug.

Everything works in both Kasa and Tapo apps for iPhone.

I can sucessfully add Tapo cameras (C120 & C325WB) in HA via the TP-Link Smart Home integration, but none of the new P115s will work even thou they are detected (have also tried to add them manually via IP).

When I connected the new P115 plugs to my Tapo app via bluetooth on my iPhone it did successfully complete a firmware upgrade process, current version is 1.1.3 Build 240523 Rel.175054

@p4cketw0lf
Copy link
Author

Could you post more logs including the earlier log message which includes DISCOVERY.

Digging through the logs in HA there is nothing else with the IP nor DISCOVERY. Do I need to enable some other debug?

@rytilahti
Copy link
Member

Digging through the logs in HA there is nothing else with the IP nor DISCOVERY. Do I need to enable some other debug?

My previous understanding was that you should be seeing those as long as the debug mode was enabled on the integration page (and that you had restarted homeassistant after turning it on), but if not, you can modify your homeassistant logger configuration to include kasa and homeassistant.components.tplink with the debug log level to force logging from the startup.

@rytilahti rytilahti changed the title Tapo Outlet Plugs Not working Adding Tapo P115 fails with Server response doesn't match our challenge Dec 13, 2024
@p4cketw0lf
Copy link
Author

This is all I'm seeing now after enabling debug and restarting HA

2024-12-13 16:35:09.105 DEBUG (MainThread) [kasa.transports.klaptransport] Created KLAP transport for 192.168.1.106
2024-12-13 16:35:09.105 DEBUG (MainThread) [kasa.discover] [DISCOVERY] 192.168.1.106 << {'error_code': 0,
 'result': {'device_id': 'REDACTED_41caf0f59a28e4b971072e0',
            'device_model': 'P115(US)',
            'device_type': 'SMART.TAPOPLUG',
            'factory_default': False,
            'ip': '192.168.1.106',
            'is_support_iot_cloud': True,
            'mac': '20-23-51-00-00-00',
            'mgt_encrypt_schm': {'encrypt_type': 'KLAP',
                                 'http_port': 80,
                                 'is_support_https': False,
                                 'lv': 2},
            'obd_src': 'tss',
            'owner': 'REDACTED_898E597A12B8DF20ABBCEA1',
            'protocol_version': 1}}
2024-12-13 16:35:09.105 DEBUG (MainThread) [kasa.device] Initializing 192.168.1.106 of type <class 'kasa.smart.smartdevice.SmartDevice'>

2024-12-13 16:35:16.061 DEBUG (MainThread) [homeassistant.components.tplink.coordinator] Finished fetching 192.168.1.158 data in 0.022 seconds (success: True)
2024-12-13 16:35:16.962 DEBUG (MainThread) [kasa.transports.klaptransport] Created KLAP transport for 192.168.1.106
2024-12-13 16:35:16.962 DEBUG (MainThread) [kasa.device] Initializing 192.168.1.106 of type <class 'kasa.smart.smartdevice.SmartDevice'>
2024-12-13 16:35:16.962 DEBUG (MainThread) [kasa.protocols.smartprotocol] 192.168.1.106 multi-request-batch-1-of-1 >> '{"method":"multipleRequest","request_time_milis":1734129316962,"terminal_uuid":"wJoVyFsrRk+ymtw9/G+PPg==","params":{"requests":[{"method":"component_nego"},{"method":"get_device_info"},{"method":"get_connect_cloud_state"}]}}'
2024-12-13 16:35:16.962 DEBUG (MainThread) [kasa.transports.klaptransport] Starting handshake with 192.168.1.106
2024-12-13 16:35:16.962 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.1.106/app/handshake1
2024-12-13 16:35:17.001 DEBUG (MainThread) [kasa.transports.klaptransport] Handshake1 posted at 2024-12-13 16:35:17.001320. Host is 192.168.1.106, Response status is 200, Request was 0776782bff4aa567d8ede9c1871cd43f
2024-12-13 16:35:17.001 DEBUG (MainThread) [kasa.transports.klaptransport] Handshake1 success at 2024-12-13 16:35:17.001407. Host is 192.168.1.106, Server remote_seed is: 966b7f242382907913ce044b9de58ae6, server hash is: e138a94ee32862b3abd25bdaf3ac4a8eb95d6b54c172365c430da5bfd393aff7
2024-12-13 16:35:17.001 DEBUG (MainThread) [kasa.transports.klaptransport] Server response doesn't match our challenge on ip 192.168.1.106
2024-12-13 16:35:17.001 DEBUG (MainThread) [kasa.protocols.smartprotocol] Unable to authenticate with 192.168.1.106, not retrying: Server response doesn't match our challenge on ip 192.168.1.106

@sdb9696
Copy link
Contributor

sdb9696 commented Dec 13, 2024

How did you provision the device? It says tss but I’m not sure what that means. The most standard is for it to say tplink

@p4cketw0lf
Copy link
Author

Its being discovered. I also tried doing directly with add device and then entering IP address. Results the same.

Same issue on #113137 but no clear resolution on that. I did try rebooting the device by pulling power and that did not help.

@crag364
Copy link

crag364 commented Dec 16, 2024

I had a similar issue with one of my smart plugs. Try removing it from the Tapo app and then completing an hard reset by holding the power button on it for 10 seconds until it blinks a green flashing light. Once it has done this, re-add it to tapo app and then try adding it to HA again. I think on my plug it hadn't synced the username/password correctly and doing the hard reset seemed to resolve this.

@dhilltx
Copy link

dhilltx commented Dec 16, 2024

I had a similar issue with one of my smart plugs. Try removing it from the Tapo app and then completing an hard reset by holding the power button on it for 10 seconds until it blinks a green flashing light. Once it has done this, re-add it to tapo app and then try adding it to HA again. I think on my plug it hadn't synced the username/password correctly and doing the hard reset seemed to resolve this.

I just did this on 1 of 3 new plugs and it fixed my problem, same prompt for username & password but it worked this time, thanks for the 101 suggestion!

@p4cketw0lf
Copy link
Author

Odd, its not working for me. It never blinked green only blue? Remove from app, it resets on its own. Hold down for 10 seconds and it blinks blue fast then goes to orange/blue. Re-set up in app, same error in home assistant after. It fails so fast its almost like its not even trying to hit Tapo cloud auth before it fails.

@crag364
Copy link

crag364 commented Dec 16, 2024

Looks like blue is correct for the p115: https://www.tapo.com/uk/faq/30/ mine was the p100.

@dhilltx
Copy link

dhilltx commented Dec 16, 2024

Odd, its not working for me. It never blinked green only blue? Remove from app, it resets on its own. Hold down for 10 seconds and it blinks blue fast then goes to orange/blue. Re-set up in app, same error in home assistant after. It fails so fast its almost like its not even trying to hit Tapo cloud auth before it fails.

My experiences were different, but all sucessful. I do not have the Matter (BETA) installed but still have the Third-Party Compatibility On in the Tapo app, I haven't tried turning it off yet).

Plug 1 = I removed from Tapo app, held the button for 10 secs and it powered up my device (e.g. reset to on). It popped up in my app to add, but I ignored and setup manually via Bluetooth instead. During setup it detected a previous configuration and asked if I wanted to reuse or discard. I chose discard and completed setup normally. When I returnned to Home Assistant I had to enter email address and password (not username) and it worked!

Plug 2 = Similar process but never mentioned previous config or disgard, and honestly I didn't notice any green lights, just blue & orange under my finger. When I returnned to Home Assistant I had to enter email address and password (not username) and it worked! I just clicked add on the detected things, not via Integration or IP like others have suggested.

Plug 3 = Similar process, but this time no discard option either and I wasn't prompted for username & password in Home Assistant. This time I just clicked add and it asked me to confirm the area.

I'm good to go!

@p4cketw0lf
Copy link
Author

Odd, its not working for me. It never blinked green only blue? Remove from app, it resets on its own. Hold down for 10 seconds and it blinks blue fast then goes to orange/blue. Re-set up in app, same error in home assistant after. It fails so fast its almost like its not even trying to hit Tapo cloud auth before it fails.

My experiences were different, but all sucessful. I do not have the Matter (BETA) installed but still have the Third-Party Compatibility On in the Tapo app, I haven't tried turning it off yet).

Plug 1 = I removed from Tapo app, held the button for 10 secs and it powered up my device (e.g. reset to on). It popped up in my app to add, but I ignored and setup manually via Bluetooth instead. During setup it detected a previous configuration and asked if I wanted to reuse or discard. I chose discard and completed setup normally. When I returnned to Home Assistant I had to enter email address and password (not username) and it worked!

Plug 2 = Similar process but never mentioned previous config or disgard, and honestly I didn't notice any green lights, just blue & orange under my finger. When I returnned to Home Assistant I had to enter email address and password (not username) and it worked! I just clicked add on the detected things, not via Integration or IP like others have suggested.

Plug 3 = Similar process, but this time no discard option either and I wasn't prompted for username & password in Home Assistant. This time I just clicked add and it asked me to confirm the area.

I'm good to go!

Are these 115s or another model?

@p4cketw0lf
Copy link
Author

Ok so I got 1 working using the methods that @dhilltx pointed out!

  1. Remove from App
  2. Reset plug
  3. In app, add new device manually by model number and setup as normal. There was nothing about previous config.

Here is the interesting thing. When setting these up in the app. When it discovers them on its own, it shows an image of a European style plug either P105A or TP10 NOT the P115. I think that perhaps its discovering them as a wrong device in Tapo app and apply some sort of other config?! Possible GDPR protection maybe or something? When telling it the specific model its the correct image during setup. That's the only thing I can think of.

@dhilltx
Copy link

dhilltx commented Dec 16, 2024

Ok so I got 1 working using the methods that @dhilltx pointed out!

  1. Remove from App
  2. Reset plug
  3. In app, add new device manually by model number and setup as normal. There was nothing about previous config.

Here is the interesting thing. When setting these up in the app. When it discovers them on its own, it shows an image of a European style plug either P105A or TP10 NOT the P115. I think that perhaps its discovering them as a wrong device in Tapo app and apply some sort of other config?! Possible GDPR protection maybe or something? When telling it the specific model its the correct image during setup. That's the only thing I can think of.

I can confirm I saw a foreign recepticle icon in the app auto detection also, glad you are up and running!

@dcb200270
Copy link

Same issue except with a bunch of P100's. This fix worked perfectly as described above.

  1. Remove from App
  2. Turn plug off and on
  3. Add device manually via Tapo App

Home Assistant then allowed plugs to join with no user/password errors.

@1981mofo
Copy link

i tried these steps and had no luck with my HS200 & HS220

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

No branches or pull requests

8 participants