HolgiHab
(Holgi)
January 16, 2019, 1:23pm
22
Yes, with the so-called “man-in-the-middle”-method. In a nutshell, it includes setting up a proxy on a smartphone and let the bulbs connect to the phone during the initial setup, while you capture the information sent by the bulbs with the proxy.
Find a instruction here:
**YMMV**: Tuya likes to change their website frequently and the below instructions may be slightly out of date. If something looks wrong, please open a new issue.
**Note**: both methods below require that your device works with the official Tuya Smart app. If your device only works with one specific app, it almost certainly won't work with TuyAPI.
All methods below require you to install the CLI tool before proceeding.
Install it by running `npm i @tuyapi/cli -g`. If it returns an error, you may need to prefix the command with `sudo`. (Tip: using `sudo` to install global packages is not considered best practice. See [this NPM article](https://docs.npmjs.com/getting-started/fixing-npm-permissions) for some help.)
## Listing Tuya devices from the **Tuya Smart** or **Smart Life** apps
This method is fast and easy. If you're having trouble manually linking your device with the below method, we recommend you try this. All devices that you want to use **must** be registered in either the Tuya Smart app or the Smart Life app.
1. Follow steps 1 through 3 from the "Linking a Tuya device with Smart Link" method below.
2. Go to Cloud -> Development and click the project you created earlier. Then click the "Devices" tab. Click the "Link Tuya App account" tab, and select the right data center in the upper right dropdown (eg Western America).
3. Click "Add App Account" and scan the QR code from your smart phone/tablet app by going to the 'Me' tab in the app, and tapping a QR code / Scan button in the upper right. Your account will now be linked.
4. On the command line, run `tuya-cli wizard`. It will prompt you for required information, and will then list out all your device names, IDs, and keys for use with TuyAPI. Copy and save this information to a safe place for later reference.
## Linking a Tuya device with Smart Link
This method requires you to create a developer account on [iot.tuya.com](https://iot.tuya.com). It doesn't matter if the device(s) are currently registered in the Tuya Smart app or Smart Life app or not.
This file has been truncated. show original
In my case, the bulbs already have been set up, and I did not have a iPhone I found the method with emulator more convenient as you have a plain text file where you just need to copy&paste the local keys.
2 Likes