Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Apr 16, 2024
1 parent 7896b7f commit 787dc5f
Showing 1 changed file with 41 additions and 4 deletions.
45 changes: 41 additions & 4 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ parameters defined at device level in database, the parameters are inherit from

Group service uniqueness is defined by the combination of: service, subservice and apikey

Device uniqueness is defined by the combination of: service, subservice, device_id and apikey. Note that several
devices with the same device_id are allowed in the same service and subservice as long as their apikeys are different.
Device uniqueness is defined by the combination of: service, subservice, device_id and apikey. Note that several devices
with the same device_id are allowed in the same service and subservice as long as their apikeys are different.

## Special measures and attributes names

Expand Down Expand Up @@ -314,6 +314,43 @@ e.g.:
}
```

Metadata could also has `expression` like attributes in order to expand it:

e.g.:

```json
{
"entity_type": "Lamp",
"resource": "/iot/d",
"protocol": "PDI-IoTA-UltraLight",
..etc
"commands": [
{"name": "on","type": "command"},
{"name": "off","type": "command"}
],
"attributes": [
{"object_id": "s", "name": "state", "type":"Text"},
{"object_id": "l", "name": "luminosity", "type":"Integer",
"metadata":{
"unitCode":{"type": "Text", "value" :"CAL"}
}
}
],
"static_attributes": [
{"name": "category", "type":"Text", "value": ["actuator","sensor"]},
{"name": "controlledProperty", "type": "Text", "value": ["light"],
"metadata":{
"includes":{"type": "Text",
"value" :["state", "luminosity"],
"expression": "level / 100"
},
"alias":{"type": "Text", "value" :"lamp"}
}
},
]
}
```

### NGSI-LD data and metadata considerations

When provisioning devices for an NGSI-LD Context Broker, `type` values should typically correspond to one of the
Expand Down Expand Up @@ -525,8 +562,8 @@ expression. In all cases the following data is available to all expressions:
- `subservice`: device subservice
- `staticAttributes`: static attributes defined in the device or config group

Additionally, for attribute expressions (`expression`, `entity_name`) and `entityNameExp` measures are avaiable in the
**context** used to evaluate them.
Additionally, for attribute expressions (`expression`, `entity_name`) , `entityNameExp` andmetadata expressions
(`expression`) measures are avaiable in the **context** used to evaluate them.

### Examples of JEXL expressions

Expand Down

0 comments on commit 787dc5f

Please sign in to comment.