The profile
field of an asset defines the data type. Both simple types like integer as well as more complex and custom data types with numerous fields are possible. The full structure looks like
"asset": {
"profile": {
"type": "integer"
}
}
When setting an asset profile using AllThingsTalk Maker, ommit the
asset
andprofile
tags.
{
"type": "integer"
}
Use type
field to define the asset’s state data type. It describes how to interpret the asset state value(s).
Simple string value type
{
"type": "string"
}
If you want to define a set of valid string values
{
"type": "string",
"enum": ["yes", "no", "maybe"]
}
Simple boolean value type.
{
"type": "boolean"
}
Simple integral number value
{
"type": "integer"
}
Simple decimal number value
{
"type": "number"
}
By defining minimum and maximum bounds, the platform ensures that the state value is validated to be in the defined range.
{
"type": "integer",
"minimum": 0,
"maximum": 255
}
Use this field to label the unit of measurement of the physical quantity that this asset reports or actuates upon.
{
"type": "integer",
"unit" : "mV"
}
You can specify up to 5 threshold values for your asset, for example: minimum
, optimum
and maximum
. These threshold constants can later be shown in device and pinboard charts.
{
"type": "number",
"threshold": [
{
"title": "optimum",
"value": 23
}
]
}
Custom object value. The object
and
{
"type": "object",
"properties": {
"city": { "type": "string" },
"latitude": { "type": "number" },
"longitude": { "type": "number" }
}
}
For more profile examples (and which Controls they support) please visit the Controls section.