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",
],
"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":
}
},
How to replace the count above in order to get the below outcome ?
"type": "geo:json",
"value":
,
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
Field | Original Value | New Value |
---|---|---|
Component/s | FIWARE-TECH-HELP [ 10278 ] |
Assignee | Jose Gato Luis [ josegato ] |
Assignee | Jose Gato Luis [ josegato ] | Roberto Castillo [ roberto.castillo ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Answered [ 10104 ] |
Resolution | Done [ 10000 ] | |
Status | Answered [ 10104 ] | Closed [ 6 ] |
Summary | [fiware-stackoverflow] FIWARE IoT Agent Framework: How to define a device with nested attributes in IoT Agent e.g geo:json? | FIWARE.Question.Tech.FIWARE IoT Agent Framework: How to define a device with nested attributes in IoT Agent e.g geo:json?. |