Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Open
p4cketw0lf opened this issue Dec 13, 2024 · 31 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

@TheHairforce
Copy link

I have the same Issue sadly.

  • Reset the Plug
  • Changed Password
  • Tested it with a new TAPO-Account
  • Used another Network
  • etc.

No luck so far, I still get that weird Error... And can't get my 4 Plugs to work...

@Piotruch88
Copy link

I have the same Issue sadly.

  • Reset the Plug
  • Changed Password
  • Tested it with a new TAPO-Account
  • Used another Network
  • etc.

No luck so far, I still get that weird Error... And can't get my 4 Plugs to work...

I did the same and I can't integrate my tapo plug (P115M) with home assistant.
The interesting thing is that this integration works perfectly with the Home Assistant instance that I had running on docker in Synology. Only on my target HAOS it doesn't want to connect in any way 😠

@p4cketw0lf
Copy link
Author

I have the same Issue sadly.

  • Reset the Plug
  • Changed Password
  • Tested it with a new TAPO-Account
  • Used another Network
  • etc.

No luck so far, I still get that weird Error... And can't get my 4 Plugs to work...

I did the same and I can't integrate my tapo plug (P115M) with home assistant. The interesting thing is that this integration works perfectly with the Home Assistant instance that I had running on docker in Synology. Only on my target HAOS it doesn't want to connect in any way 😠

Did you manually hit the plus sign and choose the exact model of your plug and connect to it that way? Do not use the auto discovery to add it.

@TheHairforce
Copy link

I did the same and I can't integrate my tapo plug (P115M) with home assistant. The interesting thing is that this integration works perfectly with the Home Assistant instance that I had running on docker in Synology. Only on my target HAOS it doesn't want to connect in any way 😠

I got it to work! - Though I'm not sure what fixed it. I haven't changed anything at all, haven't reset my Password, haven't reinstalled anything and so on.

The only thing I changed: I always added my Mail-Adress in HA "Non-Case-Sensitive" (because it always worked that way) After I tried it Case-Sensitive (like it was shown in the Tapo App): Worked instantly...

Very weird.

@rytilahti
Copy link
Member

The only thing I changed: I always added my Mail-Adress in HA "Non-Case-Sensitive" (because it always worked that way) After I tried it Case-Sensitive (like it was shown in the Tapo App): Worked instantly...

This is a very good observation. For most of the devices, the username/email address is hashed when sent to the device, so the casing matters and my@example.com is different from MY@example.com.

So to anyone who is getting this error, please make sure that your e-mail address uses the same casing as your account does.

@1981mofo
Copy link

1981mofo commented Jan 3, 2025

I did the same and I can't integrate my tapo plug (P115M) with home assistant. The interesting thing is that this integration works perfectly with the Home Assistant instance that I had running on docker in Synology. Only on my target HAOS it doesn't want to connect in any way 😠

I got it to work! - Though I'm not sure what fixed it. I haven't changed anything at all, haven't reset my Password, haven't reinstalled anything and so on.

The only thing I changed: I always added my Mail-Adress in HA "Non-Case-Sensitive" (because it always worked that way) After I tried it Case-Sensitive (like it was shown in the Tapo App): Worked instantly...

Very weird.

where in HA did you make it "Non-Case-Sensitive" ?

@Piotruch88
Copy link

The only thing I changed: I always added my Mail-Adress in HA "Non-Case-Sensitive" (because it always worked that way) After I tried it Case-Sensitive (like it was shown in the Tapo App): Worked instantly...

This is a very good observation. For most of the devices, the username/email address is hashed when sent to the device, so the casing matters and my@example.com is different from MY@example.com.

So to anyone who is getting this error, please make sure that your e-mail address uses the same casing as your account does.

for me it has no importance.

@MSIMaker
Copy link

I have the same issue with P110M in AU. Firmware is 1.2.3 and listed as compatible but fails authentication every time I try to add it. Is anyone working on this issue and the camera issues with the same sort of behaviour?

@1981mofo
Copy link

was able to get my kasa devices working in HA by putting the first letter of my email in caps

@MSIMaker
Copy link

I tried with the capital first letter of email as this has worked before.....but its not working now for me.

@MSIMaker
Copy link

I logged out of both Tapo and Kasa aps on my iPhone and logged back in.

I did a hard reset of the device and re-added to Tapo app. I then let HA discover the device and connected it without issue using my email address and password all lower case as per the Tapo app account.

So there ya go....clear as mud.

The only thing I suggest is that maybe after doing the install in Tapo and updating firmware.....remove the device and re-add it to the Tapo app and then try HA.

@way-lo
Copy link

way-lo commented Jan 24, 2025

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!

Just wanted to thank you for posting this! I previously connected my first of two P115 plugs without any issue a month ago. Of note, that FW was on 1.1.2 Build 231215 Rel. 114615 and I did NOT allow a FW upgrade.

I just now tried to install my second plug. I connected it to the Tapo app and updated the FW to 1.1.3 Build 240523 Rel. 175054. Then I was met the same blockade that everyone else here is reporting:

Invalid authentication: Server response doesn't match our challenge on ip 192.168.x.xxx.

Removing the device and immediately auto-adding it back didn't work. I'm not sure if the FW update caused this hurdle. I previously did NOT have the Tapo Labs 3rd-Party compatibility turned on for the first plug and it worked fine. I turned it on while going through the madness of trying to get the second plug working. But this by itself was insufficient to get the integration to work. Capitalizing the username email also did nothing.

I used your Plug 1 technique and added it back manually with bluetooth and all of a sudden the integration worked.

@rytilahti
Copy link
Member

Thanks for your insights to find out potential reasons for this issue. @sdb9696 updated the documentation in home-assistant/home-assistant.io#37091 that will hopefully help others when encountering this issue :-)

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

No branches or pull requests