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:
- Permanently changing a value updating the device configuration: Typically used to set a default configuration such as with a Blueprint when the device is being set up.
- Temporarily Changing a value via the command button: Typically used to send a command or configure a specific parameter on a device as you also could do from an Edge or Cloud action.
- Temporarily changing a value via an event in the command stream: Typically used to replicate or slightly modify an event and send it to the 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):
- Navigate to Device > Resources.
- Locate an example lcd/.
- 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:
Temporarily Changing a value via the command button
Follow the steps below to temporarily change a value on the edge using the command button:
- Navigate to Device > Resources.
- Locate an example lcd/.
- 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.
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:
- Navigate to Device > Streams, click on it to select it.
- Locate stream :command.
- Check the last event sent in the stream:
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:
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:
- Navigate to Device > Streams
- Locate the stream :command and select it
- Click on New event button
- 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
}
- 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
}
}
Updated over 4 years ago