# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0

nodes = {
    ngsi_node = {
        type = "ngsi",

        # The HTTP REST API endpoint of the FIRWARE context broker
        endpoint = "http://46.101.131.212:1026",

        # Add an 'Auth-Token' token header to each request
        access_token = "aig1aaQuohsh5pee9uiC2Bae3loSh9wu"

        entity_id = "S3_ElectricalGrid",
        entity_type = "ElectricalGridMonitoring",

        # Create the NGSI entities during startup
        create = true

        # Rate at which we poll the broker for updates
        rate = 0.1

        # Timeout of HTTP request in seconds (default is 1, must be smaller than 1 / rate)
        timeout = 1,

        # Verification of SSL server certificates (default is true)
        verify_ssl = false,

        in = {
            signals = (
                {
                    name = "attr1",
                    ngsi_attribute_name = "attr1", # Defaults to signal 'name'
                    ngsi_attribute_type = "Volts", # Default to signal 'unit'
                    ngsi_attribute_metadatas = (
                        { name="accuracy", type="percent", value="5" }
                    )
                }
            )
        }

        out = {
            signals = (
                { name="PTotalLosses", unit="MW" },
                { name="QTotalLosses", unit="Mvar" }
            )
        }
    }
}