-
Notifications
You must be signed in to change notification settings - Fork 22
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
Response Data: ERROR: Timeout polling device #15
Comments
I tried running and forcing version 3.1. The following output makes me think there is payload, but for some reason my raspberry is not handling it correctly:
This is the payload directly from my wireshark capture running concurrently on my PC:
|
It looks like this is a 3.3 device. Can you see if you can see the device with this:
Also, is the Device ID 20 or 22 characters long? There are some 22 character devices that require an extra setting: import tinytuya
a = tinytuya.OutletDevice('here_is_my_key', '192.168.1.9', 'secret_key_here', 'device22')
a.set_version(3.3)
a.set_dpsUsed({"1": None})
data = a.status()
print(data) |
Thanks for the swift reply! I got the following readout:
The IDs have indeed 22 characters. How can I account for this on tuyapower? I see no calls to tinytuya on the test scripts. |
Found the method on init.py. Switched it as suggested and now it seems to be receiving something:
It says power data unavailable... I'm wondering if there is anything else I'm missing, I'm going over the documentation right now to see what else I might have skipped. Smart Life does read the power values from these plugs. |
Ok, provided the plug does have energy monitoring (you see wattage etc in the SmartLife app), try sending all of the DPS values you need for that power data: import tinytuya
a = tinytuya.OutletDevice('here_is_my_key', '192.168.1.9', 'secret_key_here', 'device22')
a.set_version(3.3)
a.set_dpsUsed({'1': None, '2': None, '4': None, '5': None, '6': None})
data = a.status()
print(data) Fair warning: Unfortunately I don't have any of these device22 variants so I haven't had an opportunity to do much testing or add enough error handling to work with these non-standard (maybe?) devices. I clearly need to add something for tuyapower to better handle these. |
Progress! I see the voltage. We're on the right track:
I'm going to play with the values a bit to see if I can get more values out of the vector and interpret them. |
Ah! Your device may use DSP 18, 19, and 20:
|
I tried a few different Data Point codes and got a bunch of numbers that I couldn’t make sense of. However, I noticed that the 0’s in codes 5 and 6 match what I’m getting on the app, regardless of whether power is being consumed. I have one of the plugs with my washer and both the app and tinytuya are giving me 0. I tried with a plug that I hadn’t been messing with- accurate values. I read somewhere that flooding a device with bad requests or using the wrong key can cause the device to malfunction? I’ll try resetting the old device, re-adding it to tuya and deriving new keys to see if that helps. |
That's somewhat good news. It could be a defective device or just in a bad state. A power cycle would be enough to reset the state. You shouldn't need to add it to Tuya again. Now, one thing to keep in mind is that the devices cannot handle more than one thing connecting to them at a time. You can't have the app open and run tinytuya and expect them to work. I suggest power cycling the device. It sound like the first successful code snip above would work for either device. |
Howdy,
Managed to follow the tutorial successfully to a T. I have the device IDs, I have the keys after creating an account on iot.tuya.com and running tuyapower. Whenever I try test.py:
I can ping the device, I can see the broadcast messages from the IP address on wireshark from a different PC, I have validated the IP address using the MAC address of the lightbulb (also on Smart Home App). Plug is on. Can't seem to find what I'm doing wrong. I'm new to all this (very new to python) and I have run out of troubleshooting options.
Edit: I have tried this method with two plugs that I know are connected, keys and IDs are known.
Thanks in advance,
The text was updated successfully, but these errors were encountered: