Linkage Management
Create a linkage
- API intent: config.linkage.create
- Description: This interface is used to create linkage. You can customize the trigger conditions (Conditions) and execution actions (Actions). When the trigger conditions are met, the set actions are automatically executed. Through "query.ifttt.trigger" interface and "query.ifttt.action" interface query conditions and action parameter descriptions, then create a linkage through this interface.
- Request parameters
Name |
Type |
Is required? |
Description |
name |
String |
Yes |
Linkage name |
positionId |
String |
No |
PositionID, default position when the value is empty |
conditions |
Object |
Yes |
Trigger conditions, see conditions description for details |
actions |
Object |
Yes |
Perform actions, see actions description for details |
conditions description
Name |
Type |
Is required? |
Description |
condition |
Array(Object) |
Yes |
Trigger condition content, see condition content description for details |
relation |
int |
Yes |
0: AND 1: OR Default is 0 |
condition description
Name |
Type |
Is required? |
Description |
subjectId |
string |
No |
Subject ID (Such as device id, scene id) (must be filled in with model or subjectid) |
model |
String |
No |
Object model |
triggerDefinitionId |
String |
Yes |
Trigger id |
beginTime |
String |
No |
Begin time. The format is as follows. |
endTime |
String |
No |
End time. The format is as follows. |
params |
Array(Object) |
No |
Parameters, see params description for details |
Note: Timing time format: “min hour day month week”.
- “min”: The value ranges from 0 to 59. The value \ indicates that the minute is not limited.*
- “hour”: The value ranges from 0 to 23. The value \ indicates that the hour is not limited.*
- “day”: The value ranges from 1-31, and the value \ indicates no limit to the day, any day.*
- “month”: The value ranges from 1 to 12, and the value \ indicates no limit to the month, any month.*
- “week”: The value range is 0-8, 0 means Sunday, 1-6 means Monday-Saturday, 7 means holiday, 8 means working day, value \ indicates no limit to the week*.
For example:
- “10 11 * * 1,2,3,4,5,6,0” means 11:10 am every day
- “20 18 * * 1,4,6” means 18:20 pm every Monday, Thursday and Saturday
actions description
Name |
Type |
Is required? |
Description |
action |
Array(Object) |
Yes |
Perform actions content, see actions content description for details |
action content description
Name |
Type |
Is required? |
Description |
subjectId |
String |
No |
Subject ID (Such as device id, scene id) (must be filled in with model or subjectid) |
model |
String |
No |
Object model |
actionDefinitionId |
String |
Yes |
Action Definition Id |
delayTime |
String |
No |
Delay Time, 0-59 second, 0-59 minute |
delayTimeUnit |
String |
No |
Delay Time Unit, 1-second, 2-minute |
params |
Array(Object) |
No |
Parameters, see params description for details |
params description
Name |
Type |
Is required? |
Description |
paramId |
string |
No |
Parameter id |
value |
String |
No |
value |
paramType |
String |
No |
Parameter Type |
paramUnit |
String |
No |
Parameter Unit |
- Request Demo (For more examples, please see demo)
{
"intent": "config.linkage.create",
"data": {
"name": "123456",
"positionId": "real1.768799734012641280",
"conditions": {
"condition": [
{
"triggerDefinitionId": "TD.lumi.gateway.illumination_less_than",
"model": "lumi.gateway.acn01",
"beginTime": "0 2 * * 1,2,3,4,5,6,0",
"endTime": "0 4 * * 1,2,3,4,5,6,0",
"params": [
{
"paramType": "0",
"paramUnit": "Lux",
"paramId": "PD.illumination",
"value": "10"
}
],
"subjectId": "virtual2.11774113824794"
}
],
"relation": 0
},
"actions": {
"action": [
{
"delayTimeUnit": "1",
"actionDefinitionId": "AD.lumi.gateway.open_corridor_light",
"model": "lumi.gateway.acn01",
"delayTime": "480",
"subjectId": "virtual2.11774113824794"
}
]
}
}
}
Name |
Type |
Description |
linkageId |
string |
Linkage ID |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": {
"linkageId": "L.836622570871640064"
}
}
Update linkage
- API intent: config.linkage.update
- Description: This interface is used to modify the parameter configuration and name of linkage, and does not support modifying the location of linkage.
- Request parameters
Name |
Type |
Is required? |
Description |
linkageId |
String |
Yes |
Linkage id |
name |
String |
Yes |
Linkage name |
positionId |
String |
No |
PositionID, default position when the value is empty |
conditions |
Array(Object) |
Yes |
Trigger conditions, see conditions description for details |
actions |
Array(Object) |
Yes |
Perform actions, see actions description for details |
conditions description
Name |
Type |
Is required? |
Description |
condition |
Array(Object) |
Yes |
Trigger condition content, see condition content description for details |
relation |
int |
Yes |
0: AND 1: OR Default is 0 |
condition description
Name |
Type |
Is required? |
Description |
subjectId |
string |
No |
Subject ID (Such as device id, scene id) (must be filled in with model or subjectid) |
model |
String |
No |
Object model |
triggerDefinitionId |
String |
Yes |
Trigger id |
beginTime |
String |
No |
Begin time, Format description |
endTime |
String |
No |
End time, Format description |
params |
Array(Object) |
No |
Parameters, see params description for details |
actions description
Name |
Type |
Is required? |
Description |
action |
Array(Object) |
Yes |
Perform actions content, see actions content description for details |
action description
Name |
Type |
Is required? |
Description |
subjectId |
String |
No |
Subject ID (Such as device id, scene id) (must be filled in with model or subjectid) |
model |
String |
No |
Object model |
actionDefinitionId |
String |
Yes |
Action Definition Id |
delayTime |
String |
No |
Delay Time |
delayTimeUnit |
String |
No |
Delay Time Unit, 1-second, 2-minute |
params |
Array(Object) |
No |
Parameters, see params description for details |
params description
Name |
Type |
Is required? |
Description |
paramId |
string |
No |
Parameter id |
value |
String |
No |
value |
paramType |
String |
No |
Parameter Type |
paramUnit |
String |
No |
Parameter Unit |
{
"intent": "config.linkage.update",
"data": {
"linkageId": "L.836622570871640064",
"name": "123456",
"positionId": "real1.768799734012641280",
"conditions": {
"condition": [
{
"subjectId": "virtual2.11774113824794",
"triggerDefinitionId": "TD.lumi.gateway.light_off"
}
],
"relation": 0
},
"actions": {
"action": [
{
"subjectId": "virtual2.11774113824794",
"actionDefinitionId": "AD.lumi.gateway.open_corridor_light"
}
]
}
}
}
Response parameters: NA
Response demo
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": ""
}
Delete linkage
- API intent: config.linkage.delete
- Description: This interface is used to delete linkage.
- Request parameters
Name |
Type |
Is required? |
Description |
linkageId |
String |
Yes |
Linkage ID |
{
"intent": "config.linkage.delete",
"data": {
"linkageId": "L.836624600822501376"
}
}
Response parameters: NA
Response demo
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": ""
}
Enable/disable linkage
- API intent: config.linkage.enable
- Description: This interface is used to enable and disable linkage. When linkage is disabled, even if the trigger conditions are met, the linkage execution cannot be triggered automatically.
- Request parameters
Name |
Type |
Is required? |
Description |
linkageId |
String |
Yes |
Linkage ID |
enable |
Int |
Yes |
0: disable (Does not execute even if automation is triggered) 1: enable |
{
"intent": "config.linkage.enable",
"data": {
"linkageId": "L.836622570871640064",
"enable": 0
}
}
Response parameters:NA
Response demo
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": ""
}
- API intent: query.linkage.detail
- Description: This interface is used to query the configuration details of linkage conditions and actions.
- Request parameters
Name |
Type |
Is required? |
Description |
linkageId |
String |
Yes |
Linkage id . The format is L.xxxxx. |
{
"intent": "query.linkage.detail",
"data": {
"linkageId": "L.835941240442339328"
}
}
Name |
Type |
Description |
linkageId |
string |
Linkage ID |
name |
String |
Linkage Name |
enable |
int |
Linkage status. 0: disable; 1: enable |
conditions |
Object |
Trigger conditions, see conditions description for details |
actions |
Object |
Perform actions, see actions description for details |
Conditions description
Name |
Type |
Description |
condition |
Array(Object) |
Trigger condition content, see condition content description for details |
relation |
int |
0: AND 1: OR Default is 0 |
Conditions content description
Name |
Type |
Description |
subjectId |
string |
Subject ID |
model |
String |
Object model |
triggerName |
String |
Trigger Name |
triggerDefinitionId |
String |
Trigger id |
beginTime |
String |
Begin time |
endTime |
String |
End time |
params |
Array(Object) |
Parameters, see params description for details |
actions description
Name |
Type |
Description |
action |
Array(Object) |
Perform actions content, see actions content description for details |
action content description
Name |
Type |
Description |
subjectId |
String |
Subject ID |
model |
String |
Object id |
actionName |
String |
Action Name |
actionDefinitionId |
String |
Action id |
delayTime |
String |
Delay Time |
delayTimeUnit |
String |
Delay Time Unit, 1-second, 2-minute |
params |
Array(Object) |
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 |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": {
"linkageId": "L.835941240442339328",
"enable": 1,
"name": "test",
"conditions": {
"condition": [
{
"triggerDefinitionId": "TD.lumi.gateway.illumination_less_than",
"triggerName": "Below assigned illuminance",
"model": "lumi.gateway.acn01",
"beginTime": "0 2 * * 1,2,3,4,5,6,0",
"endTime": "0 4 * * 1,2,3,4,5,6,0",
"params": [
{
"paramType": "0",
"paramUnit": "Lux",
"paramId": "PD.illumination",
"value": "10"
}
],
"subjectId": "virtual2.11774113824794"
}
],
"relation": 0
},
"actions": {
"action": [
{
"delayTimeUnit": "1",
"actionDefinitionId": "AD.lumi.gateway.open_corridor_light",
"model": "lumi.gateway.acn01",
"delayTime": "480",
"subjectId": "virtual2.11774113824794",
"actionName": "Turn on night light"
}
]
}
}
}
Query linkage list based on object ID
- API intent: query.linkage.listBySubjectId
- Description: This interface can query the associated linkage list based on the object ID.
- Request parameters
Name |
Type |
Is required? |
Description |
subjectId |
String |
Ye s |
Subject id (such as device id, sceneid) |
{
"intent": "query.linkage.listBySubjectId",
"data": {
"subjectId": "virtual2.11774113824794"
}
}
Name |
Type |
Description |
linkageId |
string |
Linkage ID |
name |
String |
Linkage Name |
enable |
int |
Linkage status. 0: disable; 1: enable |
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,
"linkageId": "L.826490791388536832",
"enable": 1,
"name": "1",
"model": "app.ifttt.v1"
},
{
"localize": 0,
"linkageId": "L.826513247100755968",
"enable": 0,
"name": "test",
"model": "app.ifttt.v1"
}
]
}
Query linkage list based on location
- API intent: query.linkage.listByPositionId
- Description: This interface is used to query the linkage list under the specified location.
- Request parameters
Name |
Type |
Is required? |
Description |
positionId |
String |
No |
PositionID, if it is empty, query all linkages under the user |
pageNum |
Int |
No |
Page number, default value 1 |
pageSize |
Int |
No |
The number of items per page, the default value is 50 |
{
"intent": "query.linkage.listByPositionId",
"data": {
"positionId": "real1.768799734012641280",
"pageSize": 50,
"pageNum": 1
}
}
Name |
Type |
Description |
data |
Array |
Automation information |
totalCount |
int |
Total number of automations |
data description
Name |
Type |
Description |
linkageId |
string |
Linkage ID |
name |
String |
Linkage Name |
enable |
int |
Linkage status. 0: disable; 1: enable |
model |
String |
Object model |
localizd |
int |
0:Cloud execution 1:Local execution 3:Clouding 4: Localizing |
positionId |
String |
Position id |
{
"code": 0,
"message": "Success",
"msgDetails": "",
"requestId": "",
"result": {
"data": [
{
"localizd": 0,
"linkageId": "L.835941240442339328",
"enable": 1,
"name": "test",
"positionId": "xxxxx",
"model": "app.ifttt.v1"
},
{
"localizd": 0,
"linkageId": "L.826490791388536832",
"enable": 1,
"name": "1",
"positionId": "xxxxx",
"model": "app.ifttt.v1"
}
],
"totalCount": 6
}
}