thingsboard-gateway icon indicating copy to clipboard operation
thingsboard-gateway copied to clipboard

[HELP]

Open diazhh opened this issue 1 year ago • 1 comments

Describe the issue I'm trying to configure the ThingsBoard Gateway to read all nodes within a specific namespace from an OPC-UA server and send each node as a separate device to ThingsBoard. The current configuration file is set up to map individual nodes to devices, but I would like to know how to automatically discover and map all nodes within a namespace dynamically, creating a separate device for each node in ThingsBoard.

I've also tried using wildcards in the deviceNodePattern, but they haven't worked as expected.

Connector name (If you need help with some connector/converter): [e.g. OPC-UAConnector] { "server": { "name": "OPC-UA Default Server", "url": "opc.tcp://192.168.0.119:51310/CogentDataHub/DataAccess", "timeoutInMillis": 5000, "scanPeriodInMillis": 5000, "disableSubscriptions": false, "subCheckPeriodInMillis": 100, "showMap": true, "security": "Basic128Rsa15", "identity": { "type": "anonymous" }, "mapping": [ { "deviceNodePattern": "Root\\.Objects\\.default\\.Simulation Items\\.Random\\.Int1", "deviceNamePattern": "FUC-128", "timeseries": [ { "key": "p_cabezal", "path": "${ns=2;s=default:Simulation Items.Random.Int1}" }, { "key": "p_inyeccion", "path": "${ns=2;s=default:Simulation Items.Random.Int4}" } ], "attributes_updates": [ { "attributeOnThingsBoard": "deviceName", "attributeOnDevice": "Root\\.Objects\\.Device1\\.serialNumber" } ] }, { "deviceNodePattern": "Root\\.Objects\\.default\\.Simulation Items\\.Random\\.Int2", "deviceNamePattern": "FUC-138", "timeseries": [ { "key": "p_cabezal", "path": "${ns=2;s=default:Simulation Items.Random.Int1}" }, { "key": "p_inyeccion", "path": "${ns=2;s=default:Simulation Items.Random.Int4}" } ], "attributes_updates": [ { "attributeOnThingsBoard": "deviceName", "attributeOnDevice": "Root\\.Objects\\.Device1\\.serialNumber" } ] } ] }, "logLevel": "DEBUG", "name": "uaa", "enableRemoteLogging": false, "id": "753c565b-da62-4d5e-ba0f-69c560e72ef1" }

Error traceback (If it was raised):

'deviceName'
Traceback (most recent call last):
  File "<input>", line 2, in <module>
KeyError: 'deviceName'

Versions (please complete the following information):

  • OS: [e.g. Ubuntu 24.04]
  • Thingsboard IoT Gateway version [e.g. 3.5.1]
  • DOCKER

diazhh avatar Sep 03 '24 21:09 diazhh

Hi, I am also interested in this!

andersenthomas98 avatar Nov 26 '24 11:11 andersenthomas98