-
I'm struggling to get the local_key for my smart plug. I have seen a few link, suggesting to download other apps to get it, but I guess there must be an easy way. Or? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @ratnick - this means there is some issue with the configuration on the Tuya IoT Cloud setup. The following things tend to cause this: API Subscribed and AuthorizedIt could be that the API is not subscribed or authorized - Ensure you have subscribed and authorized to these API service: How to: DatacenterIf your IP does not match the datacenter region you selected you will not be able to access the API. The data center regions are not logical, unfortunately. You may need to try multiple datacenters until you get one to work. Some have reported success in selecting all the datacenters in the Tuya Cloud setup and then trying different datacenters in the Wizard. I hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I did the following to make it work. Based on: https://github.com/jasonacox/tinytuya d = tinytuya.OutletDevice('DEVICE_ID_HERE', 'IP_ADDRESS_HERE', 'LOCAL_KEY_HERE')DEVICE_ID: found throug Smart Life app or through the cloud. But this wizard needs some other input (apiKey and apiSecret), which I found via the project set up in the Tuya cloud (as described in https://github.com/jasonacox/tinytuya): Cloud -> Development -> select the project you have created. Next, start with a CLI. Note: If you see crappy text (escape characters etc.), your CLI cannot handle colors. Download "ansicon" instead. Go to the place where you installed ansicon (the json files will be stored here by default. You can also move the ansicon files.
The output from the wizard:
|
Beta Was this translation helpful? Give feedback.
I did the following to make it work.
Based on: https://github.com/jasonacox/tinytuya
d = tinytuya.OutletDevice('DEVICE_ID_HERE', 'IP_ADDRESS_HERE', 'LOCAL_KEY_HERE')
DEVICE_ID: found throug Smart Life app or through the cloud.
IP_ADDRESS: This is the LOCAL IP address, for example found found via IP Scanner. The Smart Life App gives you the global address - don't use that.
LOCAL_KEY: Same as "key" found down below through the tinytuya wizard (in Python).
But this wizard needs some other input (apiKey and apiSecret), which I found via the project set up in the Tuya cloud (as described in https://github.com/jasonacox/tinytuya):
Cloud -> Development -> select the project you have created.
On …