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
-
In the Overview panel of a Thing, click the plus icon next
to Properties.
The New Property dialog opens.
- Enter the Property Key value. This should be a descriptor of the Property.
- Optional: Select a Type from the dropdown menu, and set an Initial Value.
- Depending on the Type selection, subsequent fields may appear. Enter the values as required.
- If desired, enter any optional descriptors for this Property.
-
Click Create.
The information is added to the schema.
-
Once the property has been created, you can click on the
Edit icon to make further changes to this
property.
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
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.
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 |
Metadata Definition | Description | Required? | Type |
---|---|---|---|
minimum |
Minimum value. Used for validation. | No | number |
maximum |
Maximum value. Used for validation. | No | number |
Metadata Definition | Description | Required? | Type |
---|---|---|---|
minimum |
Minimum value. Used for validation. | No | integer |
maximum |
Maximum value. Used for validation. | No | integer |
{ ... "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 } } }