Setting a Value Via the User Interface

This topic describes how to set a value using the user interface.

The Octave Dashboard offers a few options for changing the values of actuators via the Octave-enabled device:

The following subsections use the example of setting the LCD value on the LCD screen included with the mangOH Red, to illustrate the two methods for setting a value.

Permanently Changing a resource via the configured value

Follow the steps below to permanently change a resource value via the configured value (i.e. via the Resources Screen):

  1. Navigate to Device > Resources.
  2. Locate an example lcd/.
  3. Click the edit button to the right of the txt1 property, change the text value, and click Set and then Apply.
    The text on the LCD will change and this value will persist when the device is power cycled.

The change is actually a change to the device configuration.
You can know if the configuration has been processed on the device and if there was some error, looking for PUSH_CONFIGURATION_START / PUSH_CONFIGURATION_COMPLETE in the stream :inbox of your device, they also appear in the Recent changes widget of the Device details screen:

553

Temporarily Changing a value via the command button

Follow the steps below to temporarily change a value on the edge using the command button:

  1. Navigate to Device > Resources.
  2. Locate an example lcd/.
  3. Click the command button to the right of the txt1 property, enter a new text, and click Send. The text on the LCD will change but this value will not persist to the device reboot.
1354 766

The command has been sent to the device sending an event with the new value into the stream :command of the device.
You can check the event you just sent:

  1. Navigate to Device > Streams, click on it to select it.
  2. Locate stream :command.
  3. Check the last event sent in the stream:
1355

You can know if the command has been processed on the device and if there was some error, looking for COMMAND_START / COMMAND_COMPLETE or COMMAND_FAULT in the stream :inbox of your device, they also appear in the Recent changes widget of the Device details screen:

540

Temporarily Changing a value via an Event in the Command Stream

Follow the steps below to temporarily change a value by creating an event in the command stream:

  1. Navigate to Device > Streams
  2. Locate the stream :command and select it
  3. Click on New event button
  4. Fill in the elems object with the event you want to send, the format is "resource path": resource value. In the example below we change the txt1 of the lcd of the mangOH red:
{  
  "elems": {
    "lcd/txt1": "Pong !"
  },
  "hash": null,
  "location": null,
  "metadata": null
}
  1. You will see the event added to the stream :command of your device.

Like in previous example, you can know if the command has been processed on the device and if there was some error, looking for COMMAND_START / COMMAND_COMPLETE or COMMAND_FAULT in the stream :inbox of your device, they also appear in the Recent changes widget of the Device details screen.

📘

Resource Path

Most of the time you will need to change the sub resource value of a resource, in this case you add value to the resource path: /app/NAME/value.
Example of event to send in order to update a virtual resource named lightThreshold :
{
"elems": {
"virtual/lightThreshold/value": 1200
}
}

It is possible to add a timeout or ttl: time to live parameter to the event you are sending to the stream :command of a device. When this parameter is set, Octave will attempt to deliver the command to the device until it succeeds, or the timeout is exceeded. Timeout and TTL are defined as optional attributes of the event metadata field, parameter is milliseconds.

In the example below the command will timeout after 1 minute:

{  
  "elems": {
    "lcd/txt1": "Pong !"
  },
  "metadata": { 
    "ttl": 60000
  }
}