Details
-
Type:
Monitor
-
Status: Closed
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:Unknown
-
HD-Enabler:Unknown
-
HD-Node:Unknown
Description
Created question in FIWARE Q/A platform on 30-01-2023 at 08:01
Please, ANSWER this question AT https://stackoverflow.com/questions/75281590/orion-subscription-to-update-entity-attributes-from-cratedb-on-value-changes
Question:
Orion Subscription to update entity attributes from CrateDB, on value changes
Description:
Is there a convenient way to subscribe to update an attribute, each time another attribute changes?
I have this entity on Orion:
{
"id": "Asset:001",
"type": "SomeType",
"Input": {
"type": "Text",
"value": "State",
"metadata": {}
},
"Output": {
"type": "Float",
"value": null,
"metadata": {}
}
}
I subscribe to notify value changes to Quantumleap:
curl -s -o /dev/null -X POST \
'http://orion:1026/v2/subscriptions/' \
-H 'Content-Type: application/json' \
-d '{
"description": "Orion notify Quantumleap on State changhes",
"subject": {
"entities": [
],
"condition":
},
"notification": {
"http":
,
"attrs": [
"State"
],
"metadata": []
}
}'
And I got my data on CrateDB where I made some calculation.
Then I would like to get the results of this computing, and put back as an attribute to the entity Asset:001.
Now I get this done by a script, but it would be nice to achieve the same result with a subscription, is this possible?
Thanks!!
2023-01-31 05:31|CREATED monitor | # answers= 1, accepted answer= False