tuyapi
tuyapi copied to clipboard
Smart plug doesn't return Received data
Describe the bug Using tuya-cli get connects to socket but doesn't return any data.
To Reproduce
- 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):
- OS: Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
- Node Version v12.22.12
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.
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
In fact then this is such a device that needs an "set()" to get data ...