tuya Homebridge Plugin Installation Guide

tuya-LOGO

tuya Homebridge Plugin

tuya-Homebridge-Plugin-product

Product Information

Specifications

  • Product: Homebridge Plugin of Tuya
  • Version: 20240923
  • Online Version

Product Usage Instructions

Create a cloud project and grant it access to specific cloud services With the Homebridge plugin of Tuya, you can easily control smart devices connected to Tuya Developer Platform using HomeKit. Follow these steps:

  1. Create a cloud project. Ensure it is created on or after May 25, 2021.

Link your app account with the cloud project
To link your app account with the cloud project:

  1. Sign up for a Tuya app account or use an existing one.
  2. Pair and activate devices using the Tuya app.
  3. Link the app account with the cloud project.

Run the plugin
After editing the configuration file, run the plugin.

Frequently Asked Questions (FAQ)

Q: What if I encounter issues during the installation process?
A: If you encounter any issues during installation, try running the commands with sudo to execute them as an administrator.

Create a cloud project and grant it access to specific cloud services

  1. Create a cloud project. For more information, see Create a project .
    Use a cloud project created on or after May 25, 2021. If your project was created before this date, create a new one.
  2. Grant the cloud project access to the following cloud services. For more information, see Grant a project access to API calls

Access to the following cloud services is required:

  • Authorization token management
  • Smart home basic service
  • Device status notification
  1. Sign up for a Tuya app account, or use an existing one.
    Tuya apps refer to the Tuya Smart app and the Smart Life app.
  2. Pair and activate devices using the Tuya app, and make sure that at least one device is under your account.
  3. Link the app account with the cloud project. For more information, see Link a Tuya app account .

Install Homebridge

  • Read the official Homebridge document , and install Homebridge on your operating system. Tutorials on installing Homebridge on different operating systems are as follows:
  • Install Homebridge on macOS
  • Getting Started
  • Install Homebridge on Docker
  • Install Homebridge on Raspbian
  • Install Homebridge on Debian or Ubuntu Linux
  • Install Homebridge on Red Hat, CentOS or Fedora Linux
  • Install Homebridge on Windows 10
  • Other Platforms
  • Here we use macOS as an example:
  • Install Node.js.
  • Download and install Node.js, or run the following brew command:
  • 1 brew install node
  • 2. After the installation is completed, check the version for verification.
  • 1 node -v
  • 2 npm -v
  • 2. Install Homebridge and Homebridge UI.
  • 1 sudo npm install -g –unsafe-perm homebridge homebridge-config-ui-x
  • 3. Run the following command to set up Homebridge as a service. For start and stop commands, see the official documentation.
  • 1 sudo hb-service install

 Install the Homebridge plugin of Tuya

  1. Open Terminal on your Mac.
    tuya-Homebridge-Plugin (2)
  2. Install the Homebridge plugin of Tuya.

In the event of any issues during installation, add sudo before the command to run the command as an administrator.

  1. Install the plugin. 1 npm install homebridge-tuya-platform
  2. After the installation is completed, check whether the plugin is installed successfully. For more information, watch the plugin installation video .

Edit the configuration file

Before using the Homebridge plugin, edit its config.json file.

  1. Go to the homebridge-tuya-platform/config folder. 1 cd ./node_modules/homebridge-tuya-platform/config
  2. Edit the config.json file. 1 vim config.json
  3. Set values for parameters in options .
    As shown in the following figure, set values for the nine parameters. If endPoint does not exist, add it manually.tuya-Homebridge-Plugin (3)
  • username and password : Enter the username and password of your Tuya app account.
  • accessId and accessKey : Enter the Access ID and Access Secret of your project. To view the Access ID and Access Secret, go to Tuya Developer Platform , click the target project, and find Authorization Key on the Overview page. tuya-Homebridge-Plugin (4)
  • lang : Keep the default value en .
  • endPoint : Enter the cloud server address of the data center where the cloud project under your Tuya app account resides. For more information, see Mappings Between OEM App Accounts and Data Centers .

Region Endpoint

Run the plugin

  1. Go back to the homebridge-tuya-platform directory.
    1 cd ..
  2. Run the plugin. 1 homebridge -D -U ./config/ -P ./
    For more information, watch the plugin running video .

Connect to Home Kit

Make sure that Homebridge is connected to the same local area network (LAN) as the Wi-Fi network of your mobile phone. Cross-VLAN connection is not supported.

  1. Open Home on your Apple device.
  2. Scan the QR code or enter the 8-digit PIN code printed after you run the pluginto pair Homebridge. You can also find the PIN code in the config.json file.

tuya-Homebridge-Plugin (5)

Control devices on HomeKit

Now, you can view and control all smart devices connected to the Tuya app on the HomeKit dashboard.tuya-Homebridge-Plugin (6)

Common error codes and corresponding solutions

tuya-Homebridge-Plugin (7) tuya-Homebridge-Plugin (8) tuya-Homebridge-Plugin (9) tuya-Homebridge-Plugin (10)
tuya-Homebridge-Plugin (1)

Documents / Resources

PDF thumbnailHomebridge Plugin
Installation Guide · Homebridge Plugin, Homebridge, Plugin

References

Ask a Question

Use this section to ask about setup, compatibility, troubleshooting, or anything missing from this manual.

Ask a Question

Ask about setup, compatibility, troubleshooting, or anything missing from this manual. Name and email are optional.