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
Support for updating firmware for smart plugs? #577
Comments
From the looks of it, that's indeed possible but hasn't been implemented :-) I just did some googling and stumbled upon this: https://community.home-assistant.io/t/how-to-use-homeassistant-to-update-tp-link-kasa-devices/474097 and the necessary commands have also been documented in the softScheck's reverse engineering notes linked in the README of this repository. IIRC I tested the get_available_firmwares at some point and it listed the download URLs, so adding PRs to do that are welcome! :-) edit: just tested on one hs110 and here's the response for the fw list command (
I'm not going to test updating for now, but I might do it at some later point just for the sake of having tried it out at least once.. |
Okay, I didn't manage to refrain myself to giving it a quick try to see the outputs, so I set up a dummy server and run those commands. Running
Executing
If the file transfer completes (at least for a dummy html file), the ratio will be Calling While I think this should be enough information to implement the basic update functionality, it's worth testing what those commands return on a valid firmware image but I'm not going to try that out yet. |
Thanks Teemu. Will try to find some time to dive into the code and implementation before year-end. |
Sure thing! Something to consider on the implementation, this wouldn't be something we want to check in the regular 5s update cycles we have, especially as the fw query will simply timeout after some time when the device cannot access the server. On homeassistant side, this could be something that uses its own update coordinator that checks it once a day or so. |
Makes sense |
Apologies, I was unable to review this before the New Year and I'm not sure I have the availability to work on it soon. |
Thanks for your info, since two of my KP115 would not successfully update from the official servers with many many retries, I downloaded the firmware from the link reported by the "cnCloud get_intl_fw_list" command, saved it to a local webserver in my lan and successfully updated the firmware from there from 1.0.16 to 1.0.20. So it actually does work! |
Glad you got it working, and thanks a lot for reporting back! |
I'm very glad I stumbled on this because I was looking for a workaround to update a single device at a time. The Kasa iOS app AFAICT only lets you upgrade all devices you own by model. Given that there is a power loss during reboot, I wanted to be able to take steps to protect (safefy shut down) the connected device) before upgrading. I had 6 EP25's that need upgrading because the 1.0.10 firmware can cause spurious reboots when it loses connection to the TPlink cloud. So what I would up doing in case it helps anyone who finds this follow along
|
I think you're confusing @MaxRower and me 😅 |
As someone who has been wrestling with trying to get HS200 switches to upgrade (V5, FW 1.0.2) after they've been sitting in a box for several years, this thread has been hugely helpful after trying for hours with the Kasa iOS app. I wanted to add a suggestion based on my experience: for an upgrade process, consider an option to attempt a preflight/test retrieval of the firmware binary from the command line before instructing the device to attempt to retrieve it. Thank you for all of the work that has gone into this project, it is amazing to have stumbled upon it in troubleshooting rage 🤣 |
Thanks for the updates on this. I am also trying to download new firmware, but getting an error message I cannot find any info on. Is anyone familiar with this issue or what it means?
|
OK; after playing with this more, I discovered that the |
Hello. I use python-kasa through Home Assistant. Would you consider having methods to query, download, & install the latest firmware for smart plugs? Then (hypothetically) the HA integration could use them to check for newer firmware updates periodically. I did find get_available_firmwares but wasn't sure it is related. Thanks
The text was updated successfully, but these errors were encountered: