-2

I'm trying to use Orion CB and Cygnus to write information about water quality and water consume and I need to write in float type. However it is impossible to me to know if there is any possibility to write this with float or double format. Could someone tell me if this possibility exists?

Dalton Cézane
  • 3,672
  • 2
  • 35
  • 60
  • Possible duplicate of [Primitive types supported by Fiware Orion Context Broker?](https://stackoverflow.com/questions/48670901/primitive-types-supported-by-fiware-orion-context-broker) – Dalton Cézane May 08 '18 at 15:06

1 Answers1

0

As stated at FIWARE Orion documentation, you are free to specify your entities attributes using JSON format.

So, you will have your entity in the following format:

{
  "id": "entityID",
  "type": "entityType",
  "attr_1": <val_1>,
  "attr_2": <val_2>,
  ...
  "attr_N": <val_N>
}

In which each <val_n> will be in the following format:

{
  "type": <...>,
  "value": <...>,      
  "metadata": <...>
}

Thus, you can have some entity described, for example, as:

{
  "id": "sensor_ID",
  "type": "room_sensor",
  "temperature": {
     "type": "float",
     "value": 23.2
  },      
  "noise": {
     "type": "integer",
     "value": 35
  }
}

Therefore, you can use float or double as you want.

Dalton Cézane
  • 3,672
  • 2
  • 35
  • 60