diff --git a/thingsboard_gateway/connectors/opcua/opcua_connector.py b/thingsboard_gateway/connectors/opcua/opcua_connector.py index 266e706f0..655115ebc 100644 --- a/thingsboard_gateway/connectors/opcua/opcua_connector.py +++ b/thingsboard_gateway/connectors/opcua/opcua_connector.py @@ -14,6 +14,7 @@ import re import time +from uuid import UUID from concurrent.futures import CancelledError, TimeoutError as FuturesTimeoutError from copy import deepcopy from random import choice @@ -624,6 +625,14 @@ def __search_node(self, current_node, fullpath, search_method=False, result=None self._log.warning("NODE NOT FOUND - using configuration %s", fullpath) else: self._log.debug("Found in %s", node) + + # this unnecessary code is added to fix the issue with the to_string method of the NodeId class + # and can be deleted after the fix of the issue in the library + if node.nodeid.NodeIdType == ua.NodeIdType.Guid: + node.nodeid = ua.NodeId(UUID(node.nodeid.Identifier), node.nodeid.NamespaceIndex, + nodeidtype=ua.NodeIdType.Guid) + # -------------------------------------------------------------------------------------------------- + result.append(node) else: fullpath_pattern = regex.compile(fullpath)