Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-16648

FIWARE.Question.Tech.FIWARE IoT Agent Framework: How to define a device with nested attributes in IoT Agent e.g geo:json?.

    Details

    • Type: Monitor
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: FIWARE-TECH-HELP
    • Labels:

      Description

      Created question in FIWARE Q/A platform on 04-04-2020 at 13:04
      Please, ANSWER this question AT https://stackoverflow.com/questions/61027662/fiware-iot-agent-framework-how-to-define-a-device-with-nested-attributes-in-iot

      Question:
      FIWARE IoT Agent Framework: How to define a device with nested attributes in IoT Agent e.g geo:json?

      Description:
      I can't find how to define a device where its entity contains nested attributes.
      The need is to pass gps coordinates from a device to an entity having geo:json (like urn:ngsi-ld:Shelf:unit001 in tutorial https://github.com/FIWARE/tutorials.Entity-Relationships)
      Following the https://fiware-tutorials.readthedocs.io/en/latest/iot-over-mqtt/index.html the below

      curl -iX POST \
      'http://localhost:4041/iot/devices' \
      ...
      -d '{
      "devices": [
      {
      "device_id": "motion001",
      "entity_name": "urn:ngsi-ld:Motion:001",

      { "object_id": "c", "name": "count", "type": "Integer" }

      ],
      "static_attributes": [
      ...

      creates the count attribute

      {
      "id": "Motion:001",
      "type": "Motion",
      "TimeInstant": {
      "type": "DateTime",
      "value": "2020-04-04T07:52:29.00Z",
      "metadata": {}
      },
      ...
      "count": {
      "type": "Integer",
      "value": "12",
      "metadata": {
      "TimeInstant":

      { "type": "DateTime", "value": "2020-04-04T07:52:29.00Z" }

      }
      },

      How to replace the count above in order to get the below outcome ?

      "type": "geo:json",
      "value":

      { "type": "Point", "coordinates": [13.3986,52.5547] }

      ,

      In all examples and documentation the attributes are defined in one level (not nested) https://iotagent-node-lib.readthedocs.io/en/latest/api/index.html.

      Tses

        Activity

          People

          • Assignee:
            roberto.castillo Roberto Castillo
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: