Advanced Syntax

Last Updated on : 2023-05-23 02:28:40download

Tuya provides the advanced routing syntax that deals with dual-channel data points (DPs) to switch between cellular and Bluetooth network links. In the scenarios of communication links that combine cellular 4G and Bluetooth Low Energy (LE), you can define a DP that specifies the Bluetooth or cellular 4G link.

Edit DP

  1. Log in to the Tuya IoT Development Platform.

  2. Click Create.

    Advanced Syntax

    If you have created a product, click Product Management and select the desired product.

  3. Find Standard Category, and choose Outdoor Travel > Travel > Smart Electric Vehicle.

    Advanced Syntax
  4. Follow the prompts to select the smart mode and solution, complete the product information, and then click Create.

    Advanced Syntax

    For more information about how to create a product, see Create Smart Electric Vehicle and Create Products.

  5. In the step of Function Definition, click Edit in the Operation column to edit the data point.

    Advanced Syntax
  6. On the page that appears, edit the standard functions and click OK.

    Advanced Syntax

    In the field of Special Configuration, choose among three options:

    • DP Routing - Not Set: A cellular network is preferred. If a cellular network is unavailable, Bluetooth LE is used.
    • DP Routing - Bluetooth Priority: Bluetooth LE is preferred. If Bluetooth LE is disconnected, a cellular network is used.
    • DP Routing - Force Bluetooth: Bluetooth LE is forcibly used. If Bluetooth LE is disconnected, the app panel shows an error message.

Things to note

  • After you complete the settings on the Tuya IoT Development Platform, the mobile app will work in strict accordance with the specified logic. Meanwhile, we recommend that you process the embedded firmware with the same logic.
  • It is strongly recommended that a command and its response shall be routed through the same type of communication link. For example, the mobile app sends a start command over the cellular 4G network. We recommend that you let the embedded hardware of the device respond to this command over the cellular 4G network. This contributes to clear logic and easy troubleshooting.