Properties

Properties are the element of the schema that describes the device's attributes that should be expected for a given entity in the real world.

Add Properties to a Thing

  1. In the Overview panel of a Thing, click the plus icon next to Properties.
    Figure 1.


    The New Property dialog opens.
  2. Enter the Property Key value. This should be a descriptor of the Property.
  3. Optional: Select a Type from the dropdown menu, and set an Initial Value.
  4. Depending on the Type selection, subsequent fields may appear. Enter the values as required.
  5. If desired, enter any optional descriptors for this Property.
  6. Click Create.
    The information is added to the schema.
    Figure 2.


  7. Once the property has been created, you can click on the Edit icon to make further changes to this property.
    Figure 3.


Property History

The historical values and date of the Things Properties are saved each time the value of a Thing Property is updated. Past values can also be added to the history, in case there has been a disconnection, and we want to have that data recorded.

Note data retention will vary depending on your license.

Check Properties API for more details.

Example

As mentioned above, Properties-History saves a new entry every time the value of a Property from a Thing has changed.

The following example shows the syntax of a history entry in the API:

{
  "at": "2023-06-15T16:49:00Z",
  "properties": {
    "memory": 27,
    "cpu": 44
  }
}

Also, multiple timestamps can be indicated, as seen in the following example:

[
  {
    "at": "2023-06-15T16:49:00Z",
    "properties": {
      "cpu": 43,
      "memory": 27,
      "disk": 19
    }
  },
  {
    "at": "2023-06-15T16:54:00Z",
    "properties": {
      "cpu": 87,
      "memory": 69
    }
  },
  {
    "at": "2023-06-15T16:59:00Z",
    "properties": {
      "disk": 17
    }
  }
]

Check Properties-history API for more details.

Properties Detailed Information

Properties can be any one of the following types.
Note: If no type is selected, the Property will store any type from the ones listed below:
array
Expects a list of results
boolean
Expects a true/false
number
Expects any real number
integer
Expects any whole number
object
Expects a JSON object with additional properties defined.
string
Expects a series of letters and/or numbers
null
Expects no value

Depending on the property type, each property can be additionally defined with metadata.

Table 1. All property types can use the following metadata keys
Metadata Definition Description Required? Type
title Title of the property No string
description Additional content to help the user understand what the property is for. No string
unit Provides a reference unit, especially for numbers and integers. No string
readOnly Validates that a value should not be written to. Yes (default is false) boolean
Note: In the Web of Things specification from W3C, many more metadata keys are allowed. Those are not yet supported. These include "enum", "titles", "descriptions", "@type", "const", "oneOf", "writeOnly", and "format". Nor do we support "items", "minItems" or "maxItems" on Arrays, as well as "properties" or "required" on Objects yet.
Table 2. Number property types can also use the following metadata keys (plus those in "All")
Metadata Definition Description Required? Type
minimum Minimum value. Used for validation. No number
maximum Maximum value. Used for validation. No number
Table 3. Integer property types can use the following metadata keys (plus those in "All")
Metadata Definition Description Required? Type
minimum Minimum value. Used for validation. No integer
maximum Maximum value. Used for validation. No integer
Note: "String", "boolean" and "null" property types do not offer any additional definition beyond what is allowed in "all"
Below is an example properties section of a schema with examples for each of the above.
{
    ...
    "properties": {
        "rgb": {
            "type":"array",
            "title": "RGB color value",
            "description": "This property expects an array of json objects as defined below. Example value is [233,122,0]",
            "readOnly": false
        },
        "mode": {
            "type": "string",
            "title": "Operating Mode",
            "readOnly": false,
            "description": "This property expects a string. Example value is \"cleaning\" "
        },
        "temperature": {
            "type": "number",
            "title": "Temperature (F)",
            "description": "This property expects a number value (decimals are allowed). Example value is 98.6",
            "unit": "F",
            "maximum": 140.0,
            "minimum": -100.0,
            "readOnly": false
        },
        "groupId": {
            "type": "integer",
            "title": "Parent Group ID",
            "description": "This property expects a whole number value. Example is 312.",
            "minimum": 0,
            "maximum": 65535,
            "readOnly": false
        },
        "status": {
            "type": "object",
            "title": "Latest and current status",
            "description": "This property expects a JSON object which conforms to WoT schema definitions.",
            "readOnly": false
        },
        "isOn?": {
            "type": "boolean",
            "title": "Is this asset powered on?",
            "description": "This property expects either true or false",
            "readOnly": false
        }
    }
}