Installation of tuya-mqtt (I installed it in the OH-scripts-directory):Įdit config.json and adjust to your environment - for example: I also found a rather elegant way to get the essential Tuya parameters (Tuya ID and LocalKey) which I also want to share here. I noticed that it is hard for a beginner to get this done, because all information is spreaded in different threads and postings, so I decided to put it all together in a step-by-step walk through here. I spent the last few days searching through the forum to get some Tuya-Bulbs (they usually sell as “Smart life”) working in OH2. Step-by-Step guide for adding Tuya-bulbs, Wi-Fi smart LED (Smart Life app) to OH2 using tuya-mqtt.js by AgentK Tutorials & Examples Check the app you just created and click "Ok". Click the "Linked Devices by Apps" tab, and click "Add Apps". Under "Device Management" click "Linked Device" on the left side. Click "Cloud Development" in the top nav bar and click the project you created earlier. Ignore any app key and app secret values you see in this section as they are not used.ģ. This is equivalent to the `schema` value needed in step 6. Take note of the **Channel ID** you entered. Click on "Obtain SDK" 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.`). Click "App Service" in the top nav bar and click "App SDK" from the left side. The access ID and access key are equivalent to the API key and API secret values need in step 6.Ģ. After you've created a new project, click into it. Click "Cloud Development" in the top nav bar and click "Create". Create a new account on () and make sure you are logged in. It doesn't matter if the device(s) are currently registered in the Tuya Smart app or Smart Life app or not.ġ. This method requires you to create a developer account on (). Copy and save this information to a safe place for later reference. It will prompt you for required information, and will then list out all your device names, IDs, and keys for use with TuyAPI. On the command line, run `tuya-cli wizard`. 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. Click the "Linked Devices by App Account" tab.ģ. Click on "Cloud Development" in the top nav bar and click the project you created earlier. Follow steps 1 through 4 from the "Linking a Tuya device with Smart Link" method below.Ģ. All devices that you want to use **must** be registered in either the Tuya Smart app or the Smart Life app.ġ. If you're having trouble manually linking your device with the below method, we recommend you try this. # Listing Tuya devices from the **Tuya Smart** or **Smart Life** apps (highly recommended) (Tip: using `sudo` to install global packages is not considered best practice. If it returns an error, you may need to prefix the command with `sudo`. codetheweb/tuyapi/blob/master/docs/SETUP.md All methods below require you to install the CLI tool before proceeding. See section: Listing Tuya devices from the Tuya Smart or Smart Life apps (highly recommended) Follow the instructions here and add all your devices within the (tuya-/smartlife)-app.Everytime I ran into a problem with a device not working, I just switched the pv from 3.1 to 3.3 or vice versa). On the other hand, I have a lot of tuya devices here and none are using the protocol version 3.2. Please note that the underlaying TuyAPI doesn’t support protocol version 3.2 yet. One of the highlights here is the easy naming (device names instead id’s) and the OH-friendly path (for example: if you have a power strip with multiple outlets, you can access the mqtt-topic easily by tuya/powerstrip/dps/2/state). Tom rewrote his whole code with some modifications on the underlaying TuyAPI. Thanks to finally there is a working solution now. I found several postings about adding tuya devices to OH.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |