-
Notifications
You must be signed in to change notification settings - Fork 188
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
Timeout errors while toggling device state #11
Comments
Hi, Just tried it here, using turn_on() and turn_off() ... works fine, no issues at all. What state are you trying to set? |
Having the same issue here. Status is return ok but fails to turn switch on or off.
d = tinytuya.OutletDevice('xxxx', 'xxxx', 'xxxx') print('Dictionary %r' % data) and response but switch does not change state. Works fine with app. `
Thanks. Pete. |
Hi Pete, to control any Tuya device you need to make sure you have the correct device key. A 3.1 device will provide status without the correct key so it can be misleading. Did you run the Wizard ( |
Hi Jason, Many thanks for getting back to me. Yes, I did follow that process and as far as I can tell everything worked fine. When I ran the wizard it came back with a json response for my smart plug with a name, id and key which i then used to run the test.py script and it just timeout. I changed random letters in the key and get the same results so I assume the key the wizard is returning is incorrect for some reason. I will dig through the code to see if I can figure out what the problem is but my python skills are a little lacking...! Let me know if I can provide any more information to help diagnose the problem. Pete. |
Thanks, Pete! I think I found a bug. For 3.1 devices, the hexdigest was set to trim [8:][:24] based on other tuya libraries. I adjusted it to hexdigest[8:][:16] for CONTROL commands. I have pushed a new patched version (tinytuya 1.1.2), so try to upgrade see if this fixes the issue for you.
Here is the updated section FYI: Lines 419 to 441 in 917093b
|
yep. working now...... :-) Thanks, Pete. |
Thanks, Pete! I'll close this issue since it is linked to the new release. |
I'm sure there's something I'm doing wrong here, but every time I try to set the state of my OutletDevice I get timeout errors. I checked this with the example
test.py
too. I followed all the instructions for getting the device key and checked through them multiple times, and watched the linked video as well. I can get the device state fine, I just can't set it, which is what leads me to believe it's something to do with the device key. Any help or explanation as to what is happening here would be much appreciated.Thank you
The text was updated successfully, but these errors were encountered: