trigger.template.generate

The trigger.template.generate command is used to generate a trigger from a trigger template.

TR50 Request


                        {
  "1": {
    "command": "trigger.template.generate",
    "params": {
      "id": "591b6d9bfe2a13122fb0f3dd",
      "triggerName": "Set temperature alarm state if ",
      "fields": {
        "alarmKey": "temperatureAlarm",
        "alarmState": 5,
        "propertyKey": "propertyAlarm",
        "propertyValue": 212
      }
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

id

String

Yes

The ID of the trigger template to be used as the basis for the new trigger.

triggerName

String

Yes

The name to give the newly generated trigger.

fields

Array

Yes

An array of key-value pairs where the key will be found in the trigger template, and substituted for the value.

TR50 Response

If the command is sent successfully a success message and the id of the newly generated trigger is returned. Otherwise, an error and error message will be returned.


                        {
  "1": {
    "success": true,
    "params": {
      "id": "592fb1fe2a131b6d9b20f4ee"
    }
  }
}
      

Response Parameters

Name

Type

Description

id

String

The ID of the newly generated trigger.