Last Updated on : 2024-08-28 03:00:42download
In recent years, the myopia rate of students in China has been increasing year by year. One contributing factor is improper classroom lighting. In light of this, classroom lighting is expected to be retrofitted on a large scale. To meet increasing challenges and renovation requirements, how to cost-effectively make classroom lighting smart, energy-saving, and healthy in a short time window is put at the core.
For this purpose, Tuya comes up with smart classroom lighting solutions that control smart classroom devices over Zigbee and Bluetooth mesh protocols. The solutions have been implemented and proven in a host of projects.
Tuya sorts out a smart classroom template on top of these comprehensive solutions. Based on the development kit, you can create smart scenes for classroom environmental setup.
Scene features: 32 local scenes are built-in for users to choose from. Press and hold both button 3 and button 4 for about five seconds, and the scene icon blinks. Users can press the buttons to switch between scenes. The settings interface is exited if users do not operate for three seconds. The scene icon becomes steady on.
Use a millimeter-wave Doppler radar to sense the biological movement of people and determine whether a person is present in the specified place. This product can detect the light intensity.
Request method | API | Description |
---|---|---|
POST | /v1.0/light/devices/edu/purpose | Set the purpose of educational devices. Currently, six modes are designed based on the basic lighting purpose and blackboard lighting purpose. After settings, you can call the API operations to generate a variety of scenes. |
POST | /v1.0/light/smart/edu-template/class | Generate class mode with one tap. |
POST | /v1.0/light/smart/edu-template/class-over | Generate class-over mode with one tap. |
POST | /v1.0/light/smart/edu-template/siesta | Generate lunch break mode with one tap. |
POST | /v1.0/light/smart/edu-template/projection | Generate projection mode with one tap. |
POST | /v1.0/light/smart/edu-template/exam | Generate exam mode with one tap. |
POST | /v1.0/light/smart/edu-template/study | Generate study mode with one tap. |
POST | /v1.0/light/smart/edu-template/reaction | Generate space sensing configurations with one tap. |
Functional description
Assign the following purposes to numerous devices in a teaching building. Tuya’s built-in templates of commercial lighting will help to generate desirable scenes or linkages for each classroom with one tap.
API endpoint
POST /v1.0/light/devices/edu/purpose
Request parameters
Parameter | Type | Parameter type | Description | Required | Example |
---|---|---|---|---|---|
device_ids | String[] | body | The list of device IDs. | true | uQvUFxMm9J |
roomId | String | body | The ID of the specified space. | true | uQvUFxMm9J |
device_purpose | String | body | The purpose of the specified educational device. Valid values:
|
true | basicLighting |
Return parameters
Parameter | Type | Description |
---|---|---|
code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The message that is returned if the request failed. The response is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | Object | The returned result. |
Sample request
POST /v1.0/light/devices/edu/purpose
{
"device_ids": [
"0Mmpmallta"
],
"room_id": "f3OhK5UIub",
"device_purpose": "basicLighting"
}
Sample response
{
"success": true,
"t": 1573441137
}
Functional description
Generate a scene in class mode for a classroom with one tap.
API endpoint
POST /v1.0/light/smart/edu-template/class
Request parameters
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
roomId | String | body | The ID of the specified space. | true |
Return parameters
Parameter | Type | Description |
---|---|---|
code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The message that is returned if the request failed. The response is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | String | The returned result. |
Sample request
POST /v1.0/light/smart/edu-template/class
Sample response
{
"success": true,
"t": 1573441137
}
Functional description
Generate a scene in class-over mode for a classroom with one tap.
API endpoint
POST /v1.0/light/smart/edu-template/class-over
Request parameters
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
roomId | String | body | The ID of the specified space. | true |
Return parameters
Parameter | Type | Description |
---|---|---|
code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The message that is returned if the request failed. The response is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | String | The returned result. |
Sample request
POST /v1.0/light/smart/edu-template/class-over
Sample response
{
"success": true,
"t": 1573441137
}
Functional description
Generate a scene in lunch break mode for a classroom with one tap.
API endpoint
POST /v1.0/light/smart/edu-template/siesta
Request parameters
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
roomId | String | body | The ID of the specified space. | true |
Return parameters
Parameter | Type | Description |
---|---|---|
code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The message that is returned if the request failed. The response is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | String | The returned result. |
Sample request
POST /v1.0/light/smart/edu-template/siesta
Sample response
{
"success": true,
"t": 1573441137
}
Functional description
Generate a scene in projection mode for a classroom with one tap.
API endpoint
POST /v1.0/light/smart/edu-template/projection
Request parameters
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
roomId | String | body | The ID of the specified space. | true |
Return parameters
Parameter | Type | Description |
---|---|---|
code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The message that is returned if the request failed. The response is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | String | The returned result. |
Sample request
POST /v1.0/light/smart/edu-template/projection
Sample response
{
"success": true,
"t": 1573441137
}
Functional description
Generate a scene in exam mode for a classroom with one tap.
API endpoint
POST /v1.0/light/smart/edu-template/exam
Request parameters
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
roomId | String | body | The ID of the specified space. | true |
Return parameters
Parameter | Type | Description |
---|---|---|
code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The message that is returned if the request failed. The response is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | String | The returned result. |
Sample request
POST /v1.0/light/smart/edu-template/exam
Sample response
{
"success": true,
"t": 1573441137
}
Functional description
Generate a scene in study mode for a classroom with one tap.
API endpoint
POST /v1.0/light/smart/edu-template/study
Request parameters
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
roomId | String | body | The ID of the specified space. | true |
Return parameters
Parameter | Type | Description |
---|---|---|
code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The message that is returned if the request failed. The response is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | String | The returned result. |
Sample request
POST /v1.0/light/smart/edu-template/study
Sample response
{
"success": true,
"t": 1573441137
}
Functional description
Generate space sensing configurations with one tap.
API endpoint
POST /v1.0/light/smart/edu-template/reaction
Request parameters
Parameter | Type | Parameter type | Description | Required |
---|---|---|---|---|
roomId | String | body | The ID of the specified space. | true |
Return parameters
Parameter | Type | Description |
---|---|---|
code | Integer | The response code. For more information, see the error code section. It is empty if the request is successful. |
success | Boolean | Indicates whether the operation is successful. Valid values:
|
msg | String | The message that is returned if the request failed. The response is empty if the request is successful. |
t | Long | The returned 13-digit timestamp. |
result | String | The returned result. |
Sample request
POST /v1.0/light/smart/edu-template/reaction
Sample response
{
"success": true,
"t": 1573441137
}
Error codes
The following table lists common error codes for the API calls. For more error codes, see Global Error Codes.
Error code | Description |
---|---|
500 | A system error has occurred while processing your request. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback