Conditional Actions
If this, then that
Conditional actions are a meta action type which check a condition and dispatch one action if it's true, and another if it's false.
Configuration
The following fields are available in the action configuration:
condition
[string, required]: the condition to check. Example(device_battery_state == 'charging' || device_battery_state == 'full')
.passedActionName
[string, required]: the name of the action to fire if the condition is true.failedActionName
[string, optional]: the name of the action to fire if the condition is false.
Example Config
{
"actionType": "conditional_action",
"actionData": {
"condition": "(device_battery_state == 'charging' || device_battery_state == 'full')",
"passedActionName": "true_action",
"failedActionName": "false_action"
}
}
Last updated
Was this helpful?