Skip to end of metadata
Go to start of metadata

Scenario

  1. Creating a "thermometer" thing with a float property "temperature" 
  2. Using the UI or API to get current temperature value (read), or set a new value (write)

Steps

For a complete description of all the settings used for the dialog boxes in this tutorial, see Thing Settings and Thing Property Settings.

1. Create "thermometer" thing


  1. In the "Things" tab, open "Create Thing" dialog
  2. Set name of the thing
  3. Click "Save" button

A new "Thermometer" thing is added to the list in the "Things" tab. Clicking it will open the "Thing: Thermometer" tab

2. Create "temperature" property


  1. In the "Thing: Thermometer" tab, open "Property"
  2. Click to open "Create Property" dialog
  3. Set name of the property
  4. Select "persistent" as the property type (property value would be persisted by the GK)
  5. Select "float" as the data type for this property
  6. Save property

The property is added to the list, and its details are shown in the pane below it

3. Get/set property value using UI


  1. In the "Properties" section of "Thing: Thermometer", select "temperature"
  2. Click "Edit Value" button to open "Property value" dialog
  3. The current property value is shown here
  4. Click "Generate value" to generate a random value in the "Value" text area
  5. Click "Set" to retain the value in persistent memory
  6. Click "Get" to get the current property value

 

4. Get/set property value using REST API


  1. Check out the GadgetKeeper API - Thing Properties page for details on how to perform basic method operations on GadgetKeeper API using cURL or a REST API tool
  2. Obtain required parameters:
    1. obtain the Thing Id, see instructions here.
    2. obtain the property Id, such as "temperature", see instructions here
    3. create an API Key, see instructions here
  3. Use API Explorer to perform REST calls using UI
  4. Use cURL to perform REST calls using command lines:

To get property value: 

 

To set property value: 

 

 

 

 

 

 

  • No labels