Adding a Virtual Device
Field | Description |
---|
Product Manufacturer | A free-text field specifying the name of the manufacturer. |
Product Type | The Product type assigned to the Device. All Devices with a given Product type have the same properties. For example, all the properties of the same type of heat sensor model. |
Device Name | A free-text field specifying the name of the Device. |
Serial Number | The serial number assigned to the Device by the customer. |
Groups | The groups to which the Device belongs. |
Parent Device | This will place the device under the parent device in the hierarchy, this is usually used to describe a gateway/sensor relationship, when the parent device is the gateway. |
Events | This is where you input the xml manifest that defines the events the device will send. |
The XML consists of a list of events. Each event has the following properties.
Field | Description |
---|
ID | The event type of the event, such as humidity or temperature. |
| IoT Platform provides a predefined syntax (described below) and a list of the types of events that can be sent to the IoT Platform server, such as 7 for temperature, 8 for humidity, 9 for acceleration, 1001 for pressure and so on. |
| |
Name | The name of the event. |
Event type | IoT Platform has two types of events – Allowed Values events and Number. |
Number events have the following properties –
• minValue – The minimum value that can be randomly generated.
• maxValue – The maximum value that can be randomly generated.
• decimalPoints – (Optional) The number of decimal points in the number that are randomly generated.
Allowed Values events contain a list of the allowed values in which you specify the possible values that can be randomly selected from a list. This type of event has no properties.
• Virtual device frequency is set by default to generating a reading in 5-minute intervals.
• valueType – The type of value, which can be one of the following –
• gps – If valueType is gps, then there are also the following properties –
• latitude
• longitude
• altitude
The GPS coordinates are randomly generated in a radius of 3 kilometers around this coordinate.
• integer
• double
• decimal
• numeric
• unit – (Optional) A free-text field specifying the unit of the event.
Example
The following shows an example of an event tag that contains multiple event tags. Each of the event tags in the example has the properties described above. The example presents both a Number event and an Allowed Values event.
<Events>
<Event>
<Id>7</Id>
<Name>Temperature</Name>
<MinValue>-10</MinValue>
<MaxValue>40</MaxValue>
<SecondsInterval>300</SecondsInterval>
<ValueType>Decimal</ValueType>
<DecimalPoints>2</DecimalPoints>
</Event>
<Event>
<Id>8</Id>
<Name>Humidity</Name>
<MinValue>0</MinValue>
<MaxValue>100</MaxValue>
<SecondsInterval>400</SecondsInterval>
<ValueType>Decimal</ValueType>
<DecimalPoints>2</DecimalPoints>
</Event>
<Event>
<Id>1078</Id>
<Name>Motion</Name>
<AllowedValues>
<Value>0</Value>
<Value>1</Value>
</AllowedValues>
<SecondsInterval>60</SecondsInterval>
<ValueType>Integer</ValueType>
</Event>
</Events>