core: TP-Link switch stopped working after upgrade to 2023.7.0 (fixed in 2023.7.1)

Please read before posting

If you are seeing the problem, please capture a wire shark or tcpdump and post it in this issue.

If you have a different model than the ones listed below please post the model

Otherwise give this issue a 👍 instead of posting to let us know you see the issue.

This will keep the issue nice and clean

The problem

After upgrading to 2023.7.0, the following errors started appearing in the log. Below devices are pingable. I also rebooted them, restarted HA. The same error appears again.

What version of Home Assistant Core has the issue?

core-2023.7.0

What was the last working version of Home Assistant Core?

core-2023.6.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

TP Link Kasa Smart

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?

Logger: homeassistant.config_entries
Source: config_entries.py:1257`
First occurred: 5:14:18 PM (18 occurrences) 
Last logged: 5:35:35 PM

Config entry '**MASKED**' for tplink integration not ready yet: Unable to query the device 172.16.13.53: unexpected end of data: line 1 column 434 (char 433); Retrying in background
Config entry '**MASKED**' for tplink integration not ready yet: Unable to query the device 172.16.13.66: unexpected end of data: line 1 column 435 (char 434); Retrying in background
Config entry '**MASKED**' for tplink integration not ready yet: Unable to query the device 172.16.13.67: unexpected end of data: line 1 column 485 (char 484); Retrying in background
Config entry '**MASKED**' for tplink integration not ready yet: Unable to query the device 172.16.13.64: unexpected end of data: line 1 column 552 (char 551); Retrying in background
Config entry ' **MASKED**' for tplink integration not ready yet: Unable to query the device 172.16.13.63: unexpected end of data: line 1 column 325 (char 324); Retrying in background

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 37 (20 by maintainers)

Most upvoted comments

For other architectures not x86_64

Wait for https://github.com/home-assistant/core/actions/runs/5470867696 to finish and run the below:

docker exec -it homeassistant /bin/bash
pip3 install --find-links=$WHEELS_LINKS --upgrade kasa-crypt==0.2.1

I pushed that change to my production system and all is well. All was well before though.

Can’t test it in person since I’m on an airplane still for another few hours

Should be fixed in https://github.com/bdraco/kasa-crypt/pull/3 if someone wants to install that and test

Yea, the pip worked without issues now.

I can confirm that kasa-crypt 0.2.1 works perfectly on HA OS / HA Blue ODROID. All switches are now responding. Kudos @bdraco!

Understood, but doesn’t the encryption/decryption play a role in successfully connecting to these TP-Link devices? They are all on-line, and I can ping them. If my post isn’t relevant, please feel free to remove or strike-through it.

Thanks for your speedy efforts!! I’m rolling back to 2023.6.3…

The encryption only happens after the connection is established. If the connection cannot be made the encryption can’t be the problem

It’s likely a problem with the encryption library changes. Rolling back should fix it. Ideally we find source the problem instead of reverting it right away because it just means it will come back next time we upgrade the library.

But thanks for answering my original question and providing the model numbers

Just need one to trigger the issue. Any of the ones not working with the same symptom should probably be enough to find the issue