Bluetooth Low Energy Mesh Light Protocol

Last Updated on : 2022-11-24 09:20:04download

This topic describes how to configure standard fields and control methods for Bluetooth Low Energy (LE) mesh lights. After you complete the configuration, a provisioner, typically the app or gateway, can then provision a Bluetooth LE mesh light.

Note: The app in this topic can be Tuya Smart app, Smart Life app, Tuya OEM app, and the app you developed with Tuya App SDK.

Configure provisioning

For more information, see Bluetooth LE Mesh Protocol Specification.

Mesh category

The light is a standard device type and its product category value is 0x01. The specific product types are as follows:

Product Mesh category
Cool white light © 0x1011
Cool and warm white light (CW) 0x1012
Multi-color light (RGB) 0x1013
Cool white and multi-color light (RGBC) 0x1014
Cool and warm white and multi-color light (RGBCW) 0x1015

Element and model description

An element is an addressable entity within a device. This means that it is some part of a device that has at least one, independent state value that represents some condition of the element. All nodes must have at least one element. Some nodes will have multiple elements. A model defines a set of states, state transitions, state bindings, messages, and other associated behaviors. An element within a node must support one or more models and it is the model or models that define the functionality that an element has.

Element cnt: 1

element_idx model id Model Description
0 0x0000 Configuration Server model Configure a device. For example, add or delete a group.
0 0x1000 Generic OnOff Server Switch the device on/off and detect heartbeats.
0 0x1300 Light Lightness Server Adjust light brightness.
0 0x1306 Light CTL Temperature Server Adjust light color temperature.
0 0x1307 Light HSL Server Adjust light colors.
0 0x000407d0 Tuya vendor model Implement custom light control such as light mode, scene mode, and music light.

Common model opcode

Model Opcode Description
Generic OnOff Server Generic OnOff Get Query device on/off status.
Generic OnOff Server Generic OnOff Set/Generic OnOff Set Unacknowledged Switch the device on/off with or without acknowledgment.
Generic OnOff Server Generic OnOff Status Respond to device on/off status.
Light Lightness Server Light Lightness Get Query light brightness.
Light Lightness Server Light Lightness Set/Light Lightness Set Unacknowledged Adjust light brightness with or without acknowledgment.
Light Lightness Server Light Lightness Status Respond to light brightness.
Light CTL Temperature Server Light CTL Temperature Get Query light color temperature.
Light CTL Temperature Server Light CTL Temperature Set/Light CTL Temperature Set Unacknowledged Adjust light color temperature with or without acknowledgment.
Light CTL Temperature Server Light CTL Temperature Status Respond to color temperature.
Light HSL Server Light HSL Get Query light colors.
Light HSL Server Light HSL Set/Light HSL Set Unacknowledged Adjust light colors with or without acknowledgment.
Light HSL Server Light HSL Status Respond to light colors.

Light data point (DP)

DP ID DP function Model Remark
1 On/Off OnOff Model None
2 Mode Vendor Model Switch between white light and multi-color light.
3 Brightness CTL Model Lightness None
4 Color temperature CTL Model Temperature For Bluetooth LE mesh light, the value ranges from 800 to 20000.
5 Colors HSL Model The DP data is represented in the HSV model. The app or gateway will convert the DP data into the one in the HSL model and sends it to the light.
6 Scenes Vendor model Vendor’s pass-through data.
7 Countdown Vendor model Vendor’s pass-through data.
8 Music Vendor model Vendor’s pass-through data.

Note: For lights, DP 2, DP 6, and DP 8 are specially treated. The rest of the DPs using the vendor model and other custom DPs all conform to Vendor Model Pass-Through Specification.

Special vendor DPs

DP ID Model ID Data processing
DP 2 Vendor model If the data length is one, the model ID is sent directly.
DP 6 Vendor model Scene mode data is compressed from 210 bytes to 34 bytes by lossy compression.
  • Public header
    1. 0000 11xx
    2. x222 2222
  • The first unit
    • Multi-color mode: 3xx4 5566 4444 4444 5555 5555 6666 6666
    • White light mode: 3xxx 4455 4444 4444 5555 5555 xxxx xxxx
Light mode:
  • 0: 4-bit scene number, ranging from one to eight.
  • 1: 2-bit change mode, from the gradient, jumping, to static.
  • 2: 7-bit change time, ranging from 0 to 100. The unit change time is the same as the switching time.
  • 3: 1-bit color mode. 0 represents white light and 1 represents multi-color code. Unit data representation varies on mode.
  • 3:1 multi-color mode: 4 represents 9-bit hue, 5 represents 10-bit saturation, and 6 represents 10-bit value.
  • 3:0 white light mode: 4 represents 10-bit lightness, 5 represents 10-bit temperature, and 6 represents null.
DP 8 Vendor model Music DP data is compressed into one packet. Music compression algorithm
  • Music light compression algorithm: 01xx 2233 1111 1111 2222 2222 3333 3333
  • 0 represents 1-bit change modes, 1 represents 9-bit hue, 2 represents 10-bit saturation, and 3 represents 10-bit value.