Translated iotnodes

Data from devices can come in all kinds of formats. In order to get the data in a desirable and readable format a translated iotnode can be used.

In a regular iotnode the data can be spread out and hard to interpret:

{
  id: 5,
  name: 'My iotnode'
  ...,
  temp: '0x019',
  example: {
    humValue: 76000,
  }  
}

By creating a translated iotnode for this iotnode, the data is grouped, generalized and more readable:

{
  id: 6,
  name: 'My iotnode-translated'
  translatedFrom: 5,
  ...,
  value: {
    temperature: 25,
    humidity: 76
  }
}

A translated iotnode is an iotnode with a somewhat different set of attributes, including a reference to its parent iotnode. When the data of the parent iotnode gets updated, the translated iotnode's data automatically gets updated.

Model

A translated iotnode model look like this:

{
  name: String,
  description: String,
  nodeType: String,
  translatedFrom: Id,
  value: Object
}

name and description is copied from the parent iotnode upon creation. Name is also appended by "-translated ([nodeType])".
nodeType is the chosen nodeType. See the Node types section.
translatedFrom is a reference to the parent iotnode.
value contains the translated data. The format of this object is dependent of the nodeType.

Note that there may be additional attributes, depending on the nodeType of the parent iotnode.

Node types

When you create a translated iotnode you can choose the format of the translated data. Depending on what kind of iotnode you want to translate from you will have one more node types to choose from. These node types includes:

  • ngsi-compatible-device
  • simple-device
  • simple-lora-node

For a regular iotnode, the iotnodes/{id}/translators endpoint in the REST API can be used to get all node types that are available for creating a translated iotnode.

ngsi-compatible-device

Creates a value object with a format that conforms to the FIWARE-NGSI v2 standard. This is the recommended node type, as it follows a standard and provides meta information.

{
  value: {
    [entityName]: {
      "value": X
      "type": String,
      "metadata": {
        "dateModified": {
          "type": "DateTime",
          "value": String
        },
        "unit": {
          "type": "Text",
          "value": String
        }
      }
    }
  ...
  }
}

entityName is the name of the data. E.g. temperature.
value is the value of the data. The type of this attribute is defined in type.
type is an enum and can be: Number, Text, StructuredValue, DateTime, geo:json, Boolean, or None.
metadata is an object containing metadata.
metadata.dateModified is a timestamp that states when the entity was last modified. A date in ISO 8601 format. E.g. "2019-11-13T13:04:53.675Z".
metadata.unit is the unit of the data. Not present for certain types.

Read more about the FIWARE-NGSI v2 standard and the different types here.

simple-device

Creates a value object with a simple flat structure. Only for Z-Wave devices.

Example:

  value: {
    "temperature": 25.1,
    "temperatureUnit": "celsius",
    "luminance": 129,
    "moisture": 22.46
  }

simple-lora-node

Creates a value object with a format that generally is the same as the device manufacture's. Only for LoRa devices.

Supported devices

Translators are currently available for Z-Wave and LoRa. The following iotnode node types are supported:

  • zwave-device
  • lora-node

Z-Wave support

Currently the following Z-Wave command classes can be translated:

  • msensor
  • alarm
  • meter

LoRa support

Currently the following LoRa model names can be translated:

  • elsysERS-lite
  • elsysERS
  • elsys
  • rhf1s001
  • em111-din.av8.1.x.s1.x
  • arf8123aa
  • seic-4417-hb
  • ls-111p
  • ls-113p
  • lt-100ep
  • xignal-trap
  • cs-itvp-01lw03
  • pld2-l
  • oy1110
  • elsys-loriot
  • meteohelix-pro
  • b-keep
  • guppy
  • lora-strips
  • sensornode
  • squid
  • sound-sensor
  • cayenne-lpp
  • decentlab-dl-pr26