description: >

    OPC UA Template Commissioning File
    Cybus Learn - How to connect and integrate an OPC UA server
    https://learn.cybus.io/lessons/how-to-connect-and-integrate-an-opcua-server/

metadata:
    name: Example OPC UA Template
    version: 1.0.0
    provider: cybus
    homepage: https://www.cybus.io

parameters:
    opcuaHost:
        type: string
        description: OPC UA Host Address
        default: opcua.demo-this.com

    opcuaPort:
        type: integer
        description: OPC UA Host Port
        default: 51210

resources:
    opcuaConnection:
        type: Cybus::Connection
        properties:
            protocol: Opcua
            connection:
                host: !ref opcuaHost
                port: !ref opcuaPort

    RandomDataExample:
        type: Cybus::Endpoint
        properties:
            protocol: Opcua
            connection: !ref opcuaConnection
            subscribe:
                nodeId: ns=2;i=11021

    mapping:
        type: Cybus::Mapping
        properties:
            mappings:
                - subscribe:
                      endpoint: !ref RandomDataExample
                  publish:
                      topic: !sub 'example/opcua/dataexample'
