When defining an automation action, you can use the following placeholders to make actions dynamically dependent on the automation context.
The placeholder must be included by using this syntax:
// URL
PUT https://my-backend.com/api/customers/${customer.id}
// URL
DELETE https://my-backend.com/api/customers?customerId=${customer.id}
// Header
X-Product: ${thing.serialNumber}
// mail message
WARNING: High temperature detected on ${thing.name} (${metrics.temperature.value} ${metrics.temperature.unit})
Here below you can find the full list of placeholders that can be used into an automation's action.
PLACEHOLDER | DESCRIPTION | SAMPLE VALUE |
timestamp | The timestamp the automation has been triggered | 1476271832909 |
metrics.<METRIC_NAME>.value | The value of the <METRIC_NAME> metric | 101, true, 12.77, LOW_WATER |
metrics.<METRIC_NAME>.unit | The measuring unit of the <METRIC_NAME> metric | Kg, m |
metrics.<METRIC_NAME>.valueLabel | The label associated to the value in case of dictionary and thresholds. | HIGH |
metrics.<METRIC_NAME>.valueSeverity | The severity associated to the value in case of dictionary and thresholds. | CRITICAL |
thing.id | The thing identifier | asdg2354346tsdggd3456356 |
thing.name | The thing name | Printer-floor1 |
thing.serialNumber | The thing serial number | XY000001 |
thing.properties.<PROP_NAME> | The value of the property named <PROP_NAME>. | |
thing.serviceLevel | The Service Level name associated with the Thing | GOLD |
thingDefinition.id | The thing definition identifier | asdg2354346tsdggd3456356 |
thingDefinition.name | The thing definition model name | Mod123 |
thingDefinition.properties.<PROP_NAME> | The value of the property named <PROP_NAME>. | |
workSession.name | The name of the started/completed work-session | CLEANUP |
workSession.data | The JSON describing the entire started/completed work-session. | { |
partner | The JSON describing the partner where the event has been detected. | { |
customer | The JSON describing the customer where the event has been detected. | { |
location | The JSON describing the location where the event has been detected. | { |
thing | The JSON describing the thing where the event has been detected. | { |
user | The JSON describing the user where the event has been detected. | { |
order | The JSON describing the order where the event has been detected. | { |
executor.email | In case of user performed event, the email of the user who performed the operation. |
In case of command execution or parameter updated events, you have also the following placeholders:
PLACEHOLDER | DESCRIPTION |
parameter.name | The name of the updated parameter. (DEPRECATED) |
parameter.value | The value of the updated parameter. (DEPRECATED) |
command.name | The name of the executed command. (DEPRECATED) |
command.data | The parameters of the executed command. (DEPRECATED) |
Formatting date/times
By default, timestamp values are replaced with the time value in milliseconds, but it is possible to use the following placeholder suffixes to format date/time in a friendly way:
toUTCFormat
Formats the date/time using the UTC timezone.
thing.activationTimestamp.toUTCFormat ā 2018-03-25 10:34:22 UTC
toLocaleFormat
Formats the date/time using the user preferred timezone.
thing.activationTimestamp.toLocaleFormat ā 2018-03-25 11:34:22