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

Discovery/Connect broken when upgrading from 0.5.3 -> 0.5.4 #543

Closed
putterson opened this issue Nov 7, 2023 · 7 comments · Fixed by #538
Closed

Discovery/Connect broken when upgrading from 0.5.3 -> 0.5.4 #543

putterson opened this issue Nov 7, 2023 · 7 comments · Fixed by #538

Comments

@putterson
Copy link

First off thank you for your support on this project!

I have a homeassistant installation running in docker using python-kasa for integration with one HS103 switch with firmware 1.0.3. After upgrading homeassistant from 2023.10 to 2023.11 which included an upgrade of python-kasa from 0.5.3 to 0.5.4 I am no longer able to discover or directly connect to my switch. The homeassistant upgrade was purely a version bump and the integration code had no changes, so I expect the regression is in the python-kasa library.

I'm technically adept so would be willing to help investigate what caused the regression, either through homeassistant or by running the cli in a docker container. The issue may be related to this feature request: #517

@rytilahti
Copy link
Member

Are you seeing anything in the logs (after enabling logging for homeassistant.components.tplink and kasa) that could help to pinpoint the issue? Also, could you try to install the package manually using pypi and try if kasa command works as expected.

@krnhotwings
Copy link

krnhotwings commented Nov 9, 2023

Hi, I'm also having the same issue here. Problem appears to be with hostname resolution in python-kasa 0.5.4

kasa --host kasa-dac.local works in 0.5.3 but fails in 0.5.4:

Got error: SmartDeviceException('Unable to get discovery response for kasa-dac.local')

The command works just fine via IP.

@rytilahti
Copy link
Member

@krnhotwings hmm, I didn't realize hostname resolution was ever working w/ discovery, but #539 should fix that issue.

@krnhotwings
Copy link

krnhotwings commented Nov 9, 2023

Confirmed that (hacky) copy-pasting the contents of discover.py into the home assistant container's copy of discover.py (/usr/local/lib/python3.11/site-packages/kasa/discover.py) and restarting home assistant works. Thanks!

@a-technomancer
Copy link

a-technomancer commented Nov 14, 2023

I'm stuck with this issue as well. Reverting to the previous version isn't an option, so I'd like to try @krnhotwings 's temporary solution. This would only be necessary while waiting for a 0.5.5 lib release and integration into a Home Assistant release. Trouble is that I'm running Home Assistant OS in a VM and I can't find the correct file path I needed to override the discovery.py since the OS differs from what's found in the docker setup. Anybody have an idea of what that might be?

@krnhotwings
Copy link

Edited above comment... It's discover.py and not discovery.py

@a-technomancer I don't use Home Assistant OS myself, my understanding is that it uses docker to run all of the actual home assistant stuff. If you have terminal access to the machine, you might want to try running docker ps to see if it actually has containers running.

@a-technomancer
Copy link

Edited above comment... It's discover.py and not discovery.py

Yep, I made a typo because of mobile. This is the file we're both talking about

@a-technomancer I don't use Home Assistant OS myself, my understanding is that it uses docker to run all of the actual home assistant stuff. If you have terminal access to the machine, you might want to try running docker ps to see if it actually has containers running.

No worries. I tried looking for the same thing, but connecting via SSH (Terminal Add-On or linux terminal) doesn't expose docker in a way that I can interact. which docker returns no results, so I'm thinking there may be some compartmentalization going on where ssh connections don't have full access to everything running under the hood. Guess I'll wait for 0.5.5 to be available in home assistant core

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

Successfully merging a pull request may close this issue.

4 participants