Open yersey20037 opened 3 months ago
The message 'Token expires...' is OK and proves that your Tuya login details are accepted!
The TUYA ERROR is about the API (the second is consequential): Cloud Services - API Reference - Smart Home - Smart Home Basic Service - Home Management - Search for Home (You can see it in Tuya documentation)
From Tuya documentation we get: 1106 | permission deny | No permission. | You are not authorized to access the API or device. Find the error details by TID from the API logs, or check if the device has been linked.
We need to find the source of the error, but I can't duplicate the situation so I would appreciate your cooperation. What I can do is ignore the error: But the presence of one Home is essential.!
Do you have one Home defined? (in SmartLife 'Home Management' page)? Could you try to define one home? You should provide me with information on the structure of the Home you use, whether you are the 'administrator' etc...
I tested a patch that you can apply yourself, so as not to block the program. In the file 'tuyaui02.1.js': before:
445 sleep(20);
446 const h = callAPI('GET', "/v1.0/homes/" + home);
after:
445 sleep(20);
446 const h = callAPI('GET', "/v1.0/homes/" + home) || {} ;
In the image, how the tree looks without 'homes': devices are still grouped by 'rooms', but they are isolated. Best regards
If you confirm that working, I will put it in ver 2.2.
Hi, When reviewing the code I see that after obtaining the token, the next step consults the existing spaces and the next one uses the id of the space found to consult as a home but that is not the id of the home but of the space.
It's correct. "Space" is an abstraction introduced with the API ver 2, The smart-home definitions ("home", "room",...) are derived from the abstract space definitions. (ver.1). The code is correct and works (usually). :)
Again: the problem is the Tuya ERROR in the API call. :( I think the problem is in your "Home" definitions. Send a screenshot of SmartLife Home page.
Have you set the correct "const data_center" in 'config.js' ? ERRATA "I think so, because you received the correct token... " CORRIGE the token is independent from 'data_center' definition !
I confirm: after further tests, the cause of this behavior is caused by an error in the "data_center" value in 'config.js': not consistent with the one used by SmartLife/Tuya. See https://github.com/tuya/tuya-home-assistant/wiki/Countries-Regions-and-Tuya-Data-Center
Updated user 'configuration' instructions.
Sincerely In version 2.2 I will capture the error and add a specific warning.
Hello, your project seems very interesting to me. I try to run it but I get this error message. Do you know what permission this refers to?