Cloud Actions

The steps below example illustrate how to set up a Cloud Action to process events from a Cloud Stream:

  1. Navigate to Device > Cloud > Actions.
  2. Click Add Cloud Action.
  3. Set Source type to Stream.
  4. Click on Stream and select the stream from which to process events.
  5. Click on Action name and enter a meaningful name to identify the Cloud Action.
  6. (Optional) Set Input to Get HTTP response. This template illustrates how to send an HTTP request to an external API. For additional information see POSTing Data via Webhooks below.
  7. (Optional) Set Log to Log a variable. This will write information about the event to the console.
  8. (Optional) Set Output to Send a device command. This will send a command to the device. The default implementation sets some text on the LCD screen.
function(event) {
   ...
   return {
      "/my_company/devices/my_device/:command": [{"elems" : { lcd : { txt1 : "textHere" }}}]
   }
}

The Output can also be set to Write to Stream. For additional information see Simple Forwarding below.

  1. Click Continue.
  2. Modify the code as required for your cloud action.
  3. Click Create Cloud Action to create the Cloud Action.