Bartem
April 21, 2021, 1:38am
2
I believe I read tuya changed the developer site but I believe there may be a new method at the bottom of this thread… this original method did work for me a couple months ago…
Great news!
I have successfully added my Sylvania Smart+ Wifi Bulbs to HA using LocalTuya.
A Tuya IOT Development Account is needed but the instructions in the Add-On are very good.
Just note that you will lose the ability to control the lights using Amazon or Google or the Sylvania App. Only able to control with Home Assistant after connecting them to LocalTuya.
Once I got LocalTuya configured and got the Device ID and key using tuya-cli I was able to add the bulbs to my configuration.yaml.…
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 (highly recommended)
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 4 from the "Linking a Tuya device with Smart Link" method below.
2. Go to Cloud -> Project and click the project you created earlier. Then click "Link Device". Click the "Linked Devices by App Account" tab.
3. Click "Link devices by 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.
1. Create a new account on [iot.tuya.com](https://iot.tuya.com) and make sure you are logged in. Go to Cloud -> Project in the left nav drawer and click "Create". After you've created a new project, click into it. The access ID and access key are equivalent to the API key and API secret values need in step 6.
2. Go to App -> App SDK -> Develpment in the nav drawer. Click "Create" and enter whatever you want for the package names and channel ID (for the Android package name, you must enter a string beginning with `com.`). Take note of the **Channel ID** you entered. This is equivalent to the `schema` value needed in step 6. Ignore any app key and app secret values you see in this section as they are not used.
3. Go to Cloud -> Project and click the project you created earlier. Then click "Link Device". Click the "Link devices by Apps" tab, and click "Add Apps". Check the app you just created and click "Ok".
This file has been truncated. show original