Closed rosieks closed 1 year ago
Hi @rosieks ! Could you please provide a working example of your OPC UA server?
What do you mean by working example? What I would like to achieve is that value is not scalar value mapped from single node but rather complex object/type composed from multiple nodes in OPC
I meant if you've got an opcua server we could instantiate on our own, or access to test if we can support this kind of feature
Unfortunatelly OPCUA server that I use is in private network and is connected to real building. But this issue is not OPC server specific. It's just matter how do you model your context
But good example for that would be Engine from the sample here. I don't want to have two attributes Engine_Temperature
and Engine_Oxigen
. Instead I want to have one attribute Engine
and it will be object containing two attributes: Temperature
and Oxigen
. How can I map something like that?
Hi @rosieks , looking at iotagent-lib test suite, i've found this particular example that exploits reverse expression to accompliash something like the one thing you've asked. Please have a look at it and let me if you make it!
Hi @manfredipist - thanks for suggestion. After reading documentation it looks like first it requires extra plugin and second it's to solve problem of bidirectional mapping. So it doesn't solve the issue of mapping OPC node to this structure.
Hi @rosieks , it seems that the iotagent-node-lib needs flat-structured JSON provisioning and does not support complex or nested attributes. We suggest you create an issue first for the iotagent-node-lib and if it is (or will be) implemented, we will be happy to add support for the OPCUA IoT Agent as well. Regarding your case, you can monitor the "value" and "unitCode" nodes separately and then handle the aggregation logic outside the broker context.
How can I map OPC attribute to more complex json property?
For example I would like to have model like that:
Ideally it would be nice to have more detailed documentation for mapping