Trigger Configuration

A trigger contains a set of conditions or thresholds that take system readings and activates if the threshold have been met. Typically a sensor reading or control input will cause a trigger. Triggers are used to set parameters for the system to respond to with actions. You can read more about the concepts of triggers here.

Below is an example of a trigger configuration.

{
    "triggers": [{
            "type": "sensor",
            "source": "soil_1",
            "key": "soil_dry",
            "name": "Soil is Dry",
            "actions": ["turn_on_pump"],
            "frequency":"once",
            "thresholds": [
                {
                    "comparison":"gt",
                    "value":490
                }
            ]
        }]
}

The configuration above will listen for a sensor reading with the key soil_1. If the value is > 490 the turn_on_pump action will be triggered.

Settings

OptionTypeRequiredDescription
type[String]YesType of trigger. Options: sensor, control, time
key[String]YesA unique slug to identify the trigger. Name will be slugged if key not set.
name[String]NoFriendly display name of the trigger. Useful for UI.
actions[Array]NoList of action keys to be triggered.

Time Trigger Specific Settings

OptionTypeRequiredDescription
schedule[String]YesCron like schedule string. Default: * * * * * See supported formats.

Control Trigger Specific Settings

OptionTypeRequiredDescription
source[String]YesKey of sensor or control to listen for. sensor, control
frequency[String]YesNumber of times to trigger actions once trigger is active. Options: once, many
thresholds[Array]YesArray of threshold configuration objects to evaluate the reading data to. See thresholds below.

Sensor Trigger Specific Settings

OptionTypeRequiredDescription
source[String]YesKey of sensor or control to listen for. sensor, control
nested_source[String]NoKey of nested data to check for if sensor returns object.
frequency[String]YesNumber of times to trigger actions once trigger is active. Options: once, many
thresholds[Array]YesArray of threshold configuration objects to evaluate the reading data to. See thresholds below.

Thresholds

Thresholds are conditions to check trigger values against and determine if the trigger should fire. Here are the threshold configuration options below.

OptionTypeRequiredDescription
comparison[String]YesComparison to run against value. Options: eq, ne, gt, gte, lt, lte
value[Integer]YesValue to run trigger value comparison against.

Learn more about triggers under the trigger docs.