Open arturohu opened 1 year ago
@arturohu I am not sure this has something to do with the lorawan agent. I tend to think this more related with the https://github.com/telefonicaid/iotagent-node-lib.
I have set the environment variable:
IOTA_DEFAULT_EXPRESSION_LANGUAGE=jexl
with this definition of attributes:
"attributes": [{
"object_id": "temperature_1",
"name": "temperature",
"type": "Number",
"expression": "temperature_1 + 21.5"
},
{
"object_id": "barometric_pressure_0",
"name": "pressure",
"type": "Number"
},
{
"object_id": "relative_humidity_2",
"name": "relative_humidity",
"type": "Number",
"expression": "relative_humidity_2 + 21.5"
}
]
The output entity:
{
"id": "urn:WeatherObserved:test_device",
"type": "WeatherObserved",
...
"relative_humidity": {
"type": "Number",
"value": 61.5,
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2022-09-20T12:54:24.693Z"
}
}
},
"temperature": {
"type": "Number",
"value": 49.3,
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2022-09-20T12:54:24.693Z"
}
}
}
}
It is working! Thank you.
I think the "expressionLanguage" definition provisioned is being ignored.
assuming expressionLanguage
is the correct parameter to pass. on my side, i can check that there is no point in side lorawan code where this parameter is eventually dropped (it should not be the case, but you never know).
After running a group provisioning, with jexl expressions, and reporting as dummy device, the jexl expression doesn't seem to work properly.
Deploy stack:
Step 1:
Step 2:
Step 3:
Step 4:
Result:
Jexl expression it isn't working in spite of the "expressionLanguage" attribute defined on group provisioning. Moreover, the legacy expression ("expression": "${@relative_humidity_2 + 21.5}") is working.
Maybe some bad configuration. I would like to set some ternary operator with jexl expressions.