Describes the JSON object of a Device Type.
A Device Type in Ubidots can store parameters that can be applied to a new Device upon creation.
Property | Type | Description |
---|---|---|
url | String | Url of Device Type |
id | String | Id of Device Type |
name | String | Name of Device Type |
label | String | Label of Device Type |
description | String | Description of Device Type |
deviceColor | String | HTML Color of Device Type |
deviceIcon | String | Device Type Icon |
variableColor | String | HTML Color of Variables |
syntheticVariableColor | String | HTML Color of Synthetic Variables |
variables | Array of Objects | List of Variable Ids that belong to the Device Type |
properties | Array of Objects | Array of Device properties |
tags | Array | Array of tags of Device Type |
tasks | Array of Objects | Array of Tasks of Device Type |
createdAt | String | Date Device Type was created |
Variables Object
The variables object follows this structure
{
"label": "", // Variable label
"properties": {
"_icon": "tasks", // Variable icon
"_color": "#fabf5f", // Variable HTML Color
"_offset": null, // Variable offset
"_scale": null, // Variable scale
"isLocationVariable": false, // True if variables is selected as location variable for the device
"hidden": false, // True if variables is hidden
"minimum_value": null, // Minimum value of the variable
"maximum_value": null // Maximum value of the variable
},
"type": 0, // Options: [0 (Raw variable), 1 (Synthetic variable)]
"name": "", // Variable name
"description": "", // Variable description
"tags": null, // Variable tags
"derived_expr": "", // Variable expression. Only visible on synthetic variables
"unit": "" // Variable unit
}
Each key represents the following:
Property | Type | Description |
---|---|---|
label | String | Label of Variable |
properties | List | List of Variable properties, supported for: - _icon : Variable icon- _color : Variable HTML Color- _offset : Variable offset- _scale : Variable scale- isLocationVariable : True if variables is selected as location variable for the device- hidden : True if variables is hidden- minimum_value : Minimum value of the variable- maximum_value : Maximum value of the variable |
type | Integer | Options: [0 (Raw variable), 1 (Synthetic variable)] |
name | String | Variable name |
description | String | Variable description |
tags | Array | Array of Variable tags |
derived_expr | String | Variable expression. Only visible on synthetic variables |
unit | String | Variable unit |
Tasks Object
The tasks object follow this structure:
{
"id": "", // Task id
"type": "Type of task", // Options: [event, device-group, dashboard]
"name": "{{device.name}}"
}
Each key represents the following
Property | Type | Description |
---|---|---|
id | String | Id of Task |
type | String | Type of task. Options: [event, device-group, dashboard] |
name | String | Name of the Task created |
Device Type
{
"url": "https://industrial.api.ubidots.com/api/v2.0/device_types/5e1f7e5789f9bd7c4e7f1e2c",
"id": "5e1f7e5789f9bd7c4e7f1e2c",
"name": "Type name",
"label": "type-label",
"description": "Default description",
"deviceColor": "#3BA9F5",
"deviceIcon": "pencil",
"variableColor": "#FFAE58",
"syntheticVariableColor": "#",
"variables": [
{
"label": "battery",
"properties": {
"_icon": "battery-full",
"_color": "#52b06b",
"_offset": null,
"_scale": null,
"isLocationVariable": false,
"hidden": false,
"minimum_value": null,
"maximum_value": null
},
"type": 0,
"name": "Battery",
"description": "",
"tags": null,
"unit": "%"
},
{
"label": "plan",
"properties": {
"_icon": "tasks",
"_color": "#fabf5f",
"_offset": null,
"_scale": null,
"isLocationVariable": false,
"hidden": false,
"minimum_value": null,
"maximum_value": null
},
"type": 0,
"name": "Plan",
"description": "",
"tags": null,
"unit": ""
},
{
"label": "synthetic",
"properties": {
"_icon": "cloud-arrow-up",
"_color": "#5AD0C2",
"_offset": null,
"_scale": null,
"isLocationVariable": false,
"hidden": false,
"minimum_value": null,
"maximum_value": null,
"time_zone": "America/Bogota"
},
"type": 1,
"name": "Synthetic",
"description": "",
"tags": null,
"derived_expr": "{{battery}}+{{plan}}",
"unit": "W"
}
],
"properties": [
{
"key": "p1",
"text": "P1",
"type": "text",
"value": "Text as test",
"description": "Description 1"
},
{
"key": "p2",
"text": "P2",
"type": "number",
"value": 10.0,
"description": "Description 2"
},
{
"key": "p3",
"text": "P3",
"type": "list",
"value": "",
"choices": [
"t1",
"t2"
],
"options": [
{
"text": "t1",
"value": "t1"
},
{
"text": "t2",
"value": "t2"
}
],
"description": "Description 3"
},
{
"key": "p4",
"text": "P4",
"type": "date",
"value": null,
"description": "Description 4"
},
{
"key": "p5",
"text": "P5",
"type": "boolean",
"value": true,
"description": "Description 5"
},
{
"key": "p6",
"text": "P6",
"type": "json",
"value": {},
"description": "Description 6"
}
],
"tasks": [
{
"id": "658f54ba955ccd005174e67d",
"type": "event",
"name": "{{device.name}} Event"
},
{
"id": "64b1cb4d7d9cef000c0ceab0",
"type": "device-group",
"name": "{{device.name}} Device Group"
},
{
"id": "65c2fec389f8ab000eae12c3",
"type": "dashboard",
"name": "{{device.name}} Dashboard"
}
],
"createdAt": "2020-01-15T21:04:23.602975Z"
}