-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
error "REPEATED_REQUEST" when calling tuya.m.my.group.device.list #9
Comments
Hi, I'm the original contributor of the new tuya cloud API You may try my CLI script which I've developed to push data from Tuya cloud into my influx/grafana instance: https://github.com/nalajcie/tuya-cloud-to-influxdb I converted my tuya devices to tasmota because it was easier to integrate them into my smart home that way - so I don't have any device for testing currently. The script works, but returns empty list of the devices (I suspect they deleted it after some time of inactivity). You may run it with debug enabled, so You will see all of the params sent to the remote server, eg.:
(you may use the same trick with Your own scripts, as most of the output is the debug info from @tuyapi/cloud) |
thx - i now managed to get the devices list by skipping the first call and adding the groupid directly to the second call. btw: i also tried tuya-cloud-to-influxdb code, but it fails to login using |
Ok, I don't know what You're doing differently as my script just calls No token renewal is needed in new API (I've successfully used See some tips regarding how to debug it here: nalajcie/tuya-cloud-to-influxdb#3 (comment) You may also try to change |
Actually, changing countryCode in |
This may be the new requirement of the API server (we don't know as this API is undocumented). Edit: I see that I have also local changes - I'm sending Can You confirm that everything is working if You initialize API with |
@pocki80 you may also want to try @tuyapi/openapi if it works for your use case. It should be more stable and better supported since it uses an official API. |
Yeah, it would be much better. My use case was to get hourly/daily/monthly energy usage from the Tuya-based socket. I tried OpenAPI and these attributes were not available by it (searching through the docs it seems that they are still unavailable -only instantaneous V, I and P - https://docs.tuya.com/en/iot/open-api/standard-function/electrician-category/categorykgczpc/s?id=K9gf7o5prgf7s ). It turns out that the energy is not computed on the Tuya device itself, just aggregated in the cloud (so: no internet, no/invalid energy usage) - this was main reason to switch to Tasmota (energy computed in-device). |
to solve this you have to add a requestId
|
I use the example code from your "new" API method. After the successful login I can successfully fetch
tuya.m.location.list
.But then, the request
api.request({action: 'tuya.m.my.group.device.list', gid: group.groupId})
causes the response
"success":false,"errorCode":"REPEATED_REQUEST","status":"error","errorMsg":"The server is busy, please try again later"
thus the operation fails.
The text was updated successfully, but these errors were encountered: