codetheweb / tuyapi

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

Smart plug doesn't return Received data #648

Open BetaAthe opened 1 month ago

BetaAthe commented 1 month ago

Describe the bug Using tuya-cli get connects to socket but doesn't return any data.

To Reproduce

  1. Command: DEBUG=* tuya-cli get --id xxx --key xxx --ip 192.168.xxx.xxx

Expected behavior I expect a TuyAPI Received data: message in the debug logs.

Debug Output

  TuyAPI IP and ID are already both resolved. +0ms
  TuyAPI Connecting to 192.168.xxx.xxx ... +10ms
  TuyAPI Socket connected. +7ms
  TuyAPI GET Payload: +5ms
  TuyAPI {
  TuyAPI   gwId: 'xxx',
  TuyAPI   devId: 'xxx',
  TuyAPI   t: '1715078281',
  TuyAPI   dps: {},
  TuyAPI   uid: 'xxx'
  TuyAPI } +1ms
  TuyAPI Pinging 192.168.xxx.xxx+10s
  TuyAPI Disconnect +2s
  TuyAPI Socket closed: 192.168.xxx.xxx+3ms

Desktop (please complete the following information):

Additional context Just bought some smart plugs from AliExpress. I've connected them to the smart life app and I can control them from there without any issue.

Jared0430 commented 1 month ago

I am getting the same issue. it says it has connected but it immeditely disconnects.

Interestingly, I noticed that if I do not provide the IP address and the library has to search manually, it seems to all work fine.

EDIT: after specifying version: '3.4' it no longer disconnects immediately, but then I encounter the issue from #634