[ https://jira.fiware.org/browse/HELP-16648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fernando Lopez resolved HELP-16648. ----------------------------------- Resolution: Done > [fiware-stackoverflow] FIWARE IoT Agent Framework: How to define a device with nested attributes in IoT Agent e.g geo:json? > --------------------------------------------------------------------------------------------------------------------------- > > Key: HELP-16648 > URL: https://jira.fiware.org/browse/HELP-16648 > Project: Help-Desk > Issue Type: Monitor > Components: FIWARE-TECH-HELP > Reporter: Backlog Manager > Assignee: Roberto Castillo > Labels: fiware > > Created question in FIWARE Q/A platform on 04-04-2020 at 13:04 > {color: red}Please, ANSWER this question AT{color} 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 -- This message was sent by Atlassian JIRA (v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy