Creating an Edge Action

The creation of an Edge Action allows you to specify the logic that will run at the edge to handle an event from the Edge Action's associated Observation. An Edge Action is created using the Octave Dashboard which will send the Edge Action to the Octave edge device when saved.

The following steps demonstrate how to create an Edge Action:

  1. Navigate to Build > Device > Actions.
  2. Click Add Edge Action.
  3. Click Source Observation and select an Observation whose data is to be processed by the Edge Action.
  4. Click Edge Action name and enter a descriptive name.
  5. Ensure Enabled has a checkmark.
  6. Click the Code tab and enter your JavaScript logic to run in the Edge Action (i.e., to read and/or set a value):
function(event) {
    //write logic here
}

This logic will run at the edge (i.e., on the Octave device) when Events from the underlying Observation (selected in step 3) are received.

  1. Click Save on the bottom right corner to save and apply the Edge Action.

📘

Note

After saving the Edge Action, Octave will send it to the device when the device's connection is in the registered state. If the device is not in this state at the time of saving the Edge Action, Octave will store the Edge Action and send it to the device once it successfully connects.

This state is indicated by the /util/cellular/signal/status Utility Resource. For a complete list of device connectivity states see Cellular Signal Status Values.

📘

Note

When an Edge Action is assigned to a Device, the JavaScript is sent to the Device and loaded. It is bound to a specific Observation, such that when a new Event is created from the Observation, the JavaScript is executed with the Event as the input parameter.