-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Kasa KP125M not reconnecting after disconnection from power #113196
Comments
Hey there @rytilahti, @TheGardenMonkey, @bdraco, @sdb9696, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) tplink documentation |
The error implies that the device clock is not synchronized with a time-server, so allowing NTP traffic could fix the issue even when other connectivity to the Internet is cut off. Now, I am not sure why you are not receiving that error when reloading, but this will likely be fixed when a new python-kasa release is done (with python-kasa/python-kasa#754 included that changed how errors are handled). |
Ah, good to know. I will look into getting NTP working and provide an update today or tomorrow. |
Oh, and you could also set the time manually by doing something like |
Would that be run before or after Home Assistant is connected to it? Thanks for the assistance! |
Before, it should set the time so that the device doesn't error afterwards. |
I think I have it fixed (at least for now!) by redirecting pool.ntp.org to a local NTP server. I'll continue to monitor and see if the coming changes fix it without having to do this. |
I've got the same error: TIME_ERROR(-1601) for method: get_device_usage on a P110. |
Yes, it's a known problem and is waiting for upstream. The next upstream release will fix this by not failing the complete query even when one or some individual queries fail. |
You might want to try to set up an NTP server and redirect DNS to it--it worked for me! |
Thanks for this. I'm now running this every 60 seconds in a cron job:
Maybe the library should be able to synchronise the time between devices automatically? |
This was for an LB510B by the way. I don't know why a lightbulb needs accurate time synchronisation for in the first place but it's working now. |
Perhaps. python-kasa/python-kasa#951 adds a command to do this without passing payloads manually, but we could potentially perform the sync automatically when encountering out-of-sync errors. |
The problem
First, a bit of a disclaimer: I found these somewhat related issues that are closed: #102088, #99857, #97247, #94947 so I apologize if I am saying stuff that is already known. This issue might be due to these being Matter devices but I am unsure.
The integration almost works perfectly for me. I was unable to get Matter working but I totally get it since it is still in a beta stage. I was able to get the plugs connected in the Kasa app and then connect them via IP. That works pretty well, however I used different outlets for testing than where I want to deploy them. When I moved them I noticed that the plugs did not connect to Home Assistant.
I then accidentally discovered that if I allowed Internet access to the plugs, Home Assistant recognizes them and can connect. The integration continues to work with the Internet access blocked. Disabling and re-enabling the plug does not help. Deleting it an re-adding it by IP yields the error message
Connection error: Error querying device: 192.168.90.7: TIME_ERROR(-1601) for method: get_device_usage
.While disconnected from the Internet after moving the plugs I can still control the plugs using the Kasa app. Other smart plugs integrated with HA have the expected behavior and reconnect with HA without needing Internet access.
In summary:
I have two of these plugs. Both exhibit the same behaviors.
The first:
The second:
I'm new to HA and really enjoying it! Great job!
What version of Home Assistant Core has the issue?
core-2024.3.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
TP-Link Smart Home
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tplink
Diagnostics information
config_entry-tplink-e68768ebcba36e0fbb5ccf310ceb2609.json
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: