codetheweb / tuyapi

🌧 An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.
MIT License
2.1k stars 343 forks source link

json obj data unvalid #447

Closed drbytes closed 2 years ago

drbytes commented 3 years ago

Today the fedex man delivered some new smart sockets, these also have power monitoring. When I try to query the data on these new plugs it fails to read the data on the smart plug :

drbytes@Casa:~$ tuya-cli get --id bf3cf02xxxxxxxx0gn --key 381bxxxxxx26  --all
json obj data unvalid
(node:1021344) UnhandledPromiseRejectionWarning: Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('Timeout waiting for status response from device id: bf3cf02xxxxxxxx0gn ')
    at TuyaDevice.emit (events.js:187:17)
    at pTimeout (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/tuyapi/index.js:344:12)
    at Timeout.setTimeout [as _onTimeout] (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/p-timeout/index.js:25:13)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

It doesn't matter what you pass in as --protocol-version, it keeps failing. Other, older, plugs I have report states and work fine. The smartlife app is able to get values.

"json obj data unvalid" --> looks like that might actually come from the plug itself.. otherwise someone would've fixed the typo.

What's going on, are there any workarounds other than send the plugs back ?

codetheweb commented 3 years ago

This is probably related to #389. TL;DR is that it probably uses a slightly different protocol that TuyaAPI doesn't support yet.

Write commented 3 years ago

This is probably related to #389. TL;DR is that it probably uses a slightly different protocol that TuyaAPI doesn't support yet.

Any idea how could I help ? I have a Petfeeder and willing to help / debug things. I currently get the same "error" json obj data unvalid. This is the exact model I have : https://www.amazon.fr/gp/product/B08HCWBY7N

codetheweb commented 3 years ago

You might want to contact @iknop, they said they might start working on implementing 0d support.

The other thing that I've wanted to do for a while but haven't had enough bandwidth / motivation yet is a Wireshark dissector plugin for Tuya packets. Would make these kinds of efforts a lot easier. Created a new issue for it: https://github.com/codetheweb/tuyapi/issues/457, if you're familiar with C / Wireshark feel free to take a look. 😄

drbytes commented 2 years ago

THis no longer occurs