Scene Management
Create a scene
- API intent: config.scene.create
- Description: This interface is used to create a scene, you can customize the actions that need to be performed in the scene (Actions), and when the scene is triggered manually, the set actions are executed in order. After querying the action parameter description through the "query.ifttt.action" interface, create a scene through this interface.
- Request parameters
Name |
Type |
Is required? |
Description |
name |
String |
Yes |
Scene Name |
positionId |
String |
No |
Position ID, default position when the value is empty |
action |
Array(Object) |
Yes |
Perform actions, see actions description for details |
action description
Name |
Type |
Is required? |
Description |
subjectId |
String |
Yes |
Subject ID |
actionDefinitionId |
String |
Yes |
Action Definition id |
params |
Array(Object) |
Yes |
Parameters, see params description for details |
delayTime |
String |
No |
Delay Time, 0-59 second, 0-59 minute |
delayTimeUnit |
String |
No |
Delay Time Unit, 1-second, 2-minute |
params description
Name |
Type |
Description |
paramId |
string |
Parameter id |
value |
String |
value |
paramType |
String |
Parameter Type |
paramUnit |
String |
Parameter Unit |
{
"intent": "config.scene.create",
"data": {
"name": "123",
"positionId": "real1.768799734012641280",
"action": [
{
"subjectId": "virtual2.11774113824794",
"actionDefinitionId": "AD.lumi.gateway.set_corridor_light_argb",
"params": [
{
"paramType": "0",
"paramUnit": "local",
"paramId": "PD.lightARGB",
"value": "553516541"
}
]
}
]
}
}
Name |
Type |
Description |
sceneId |
String |
Scene ID |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": {
"sceneId": "AL.836646140352004096"
}
}
Update scene
- API intent: config.scene.update
- Description: This interface is used to modify the parameter configuration and name of the scene.
- Request parameters
Name |
Type |
Is required? |
Description |
sceneId |
String |
Yes |
Scene id |
name |
String |
Yes |
Scene Name |
positionId |
String |
No |
PositionID, default position when the value is empty |
action |
Array(Object) |
Yes |
Perform actions, see actions description for details |
action description
Name |
Type |
Is required? |
Description |
subjectId |
String |
Yes |
Subject ID |
actionDefinitionId |
String |
Yes |
Action Definition id |
params |
Array(Object) |
Yes |
Parameters, see params description for details |
params description
Name |
Type |
Description |
paramId |
string |
Parameter id |
value |
String |
value |
paramType |
String |
Parameter Type |
paramUnit |
String |
Parameter Unit |
{
"intent": "config.scene.update",
"data": {
"sceneId": "AL.836646140352004096",
"name": "123456",
"positionId": "real1.768799734012641280",
"action": [
{
"subjectId": "virtual2.11774113824794",
"actionDefinitionId": "AD.lumi.gateway.open_corridor_light"
}
]
}
}
Response parameters: NA
Response demo
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": ""
}
Delete scene
- API intent: config.scene.delete
- Description: This interface is used to delete scenes.
- Request parameters
Name |
Type |
Is required? |
Description |
sceneId |
String |
Yes |
Scene ID |
{
"intent": "config.scene.delete",
"data": {
"sceneId": "AL.836646140352004096"
}
}
Response parameters: NA
Response demo
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": ""
}
Execute scene
- API intent: config.scene.run
- Description: This interface is used to execute scenarios.
- Request parameters
Name |
Type |
Is required? |
Description |
sceneId |
String |
Yes |
Scene ID |
{
"intent": "config.scene.run",
"data": {
"sceneId": "AL.829804945617997824"
}
}
Response parameters: NA
Response demo
{
"code": 0,
"requestId": null,
"message": null,
"msgDetails": null,
"result": ""
}
- API intent: query.scene.detail
- Description: This interface is used to query the configuration details of each action of the scene.
- Request parameters
Name |
Type |
Is required? |
Description |
sceneId |
String |
Yes |
Scene id. The format is AL.xxxxx |
{
"intent": "query.scene.detail",
"data": {
"sceneId": "AL.836639966905348096"
}
}
Name |
Type |
Description |
sceneId |
String |
Scene ID |
name |
String |
Scene Name |
localizd |
int |
0:Cloud execution 1:Local execution 3:Clouding 4: Localizing |
action |
Array(Object) |
Perform actions, see actions description for details |
action description
Name |
Type |
Description |
subjectId |
String |
Subject ID |
model |
String |
Subject Type |
actionName |
String |
Action Name |
actionDefinitionId |
String |
Action id |
params |
Array(Object) |
Perform actions, see actions description for details |
delayTimeUnit |
String |
Condition delay unit (1-second, 2-minute) |
delayTime |
String |
Delay time |
params description
Name |
Type |
Description |
paramId |
string |
Parameter id |
value |
String |
value |
paramType |
String |
Parameter Type |
paramUnit |
String |
Parameter Unit |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": {
"localize": 0,
"sceneId": "AL.836639966905348096",
"name": "scene",
"action": [
{
"delayTimeUnit": "1",
"actionDefinitionId": "AD.lumi.gateway.set_corridor_light_argb",
"model": "lumi.gateway.acn01",
"delayTime": "0",
"params": [
{
"paramType": "0",
"paramUnit": "local",
"paramId": "PD.lightARGB",
"value": "553516541"
}
],
"subjectId": "virtual2.13107395143333",
"actionName": "Turn on the Night Light to the assigned state"
}
]
}
}
Query scene list based on object ID
- API intent: query.scene.listBySubjectId
- Description: This interface can query the associated scene list based on the object ID.
- Request parameters
Name |
Type |
Is required? |
Description |
subjectId |
String |
Yes |
Object id |
{
"intent": "query.scene.listBySubjectId",
"data": {
"subjectId": "virtual2.11774113824794"
}
}
Name |
Type |
Description |
sceneId |
string |
Scene ID |
name |
String |
Scene Name |
model |
String |
Object model |
localizd |
int |
0:Cloud execution 1:Local execution 3:Clouding 4: Localizing |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": [
{
"localize": 0,
"sceneId": "AL.826490847172780032",
"name": "2",
"model": "app.scene.v1"
},
{
"localize": 0,
"sceneId": "AL.831620188783841280",
"name": "hah",
"model": "app.scene.v1"
},
{
"localize": 0,
"sceneId": "AL.832619606283436032",
"name": "123456",
"model": "app.scene.v1"
}
]
}
Query scene list based on location
- API intent: query.scene.listByPositionId
- Description: This interface is used to query the list of scenes at the specified location.
- Request parameters
Name |
Type |
Is required? |
Description |
positionId |
String |
No |
Position ID |
pageNum |
Int |
No |
Page number, default value 1 |
pageSize |
Int |
No |
The number of items per page, the default value is 50 |
{
"intent": "query.scene.listByPositionId",
"data": {
"positionId": "real1.768799734012641280",
"pageNum": 1,
"pageSize": 5
}
}
Name |
Type |
Description |
data |
Array |
Scene information |
totalCount |
int |
Total number of scenes |
data description
Name |
Type |
Description |
sceneId |
string |
Scene ID |
name |
String |
Scene Name |
model |
String |
Object model |
localizd |
int |
0:Cloud execution 1:Local execution 3:Clouding 4: Localizing |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": {
"data": [
{
"localizd": 0,
"sceneId": "AL.832619749883822080",
"name": "123456",
"model": "app.scene.v1"
},
{
"localizd": 0,
"sceneId": "AL.832619744657719296",
"name": "123456",
"model": "app.scene.v1"
},
{
"localizd": 0,
"sceneId": "AL.832619739930738688",
"name": "123456",
"model": "app.scene.v1"
},
{
"localizd": 0,
"sceneId": "AL.832619643063287808",
"name": "123456",
"model": "app.scene.v1"
},
{
"localizd": 0,
"sceneId": "AL.832619606283436032",
"name": "123456",
"model": "app.scene.v1"
}
],
"totalCount": 7
}
}