Skip to content

microgrid_pb2_grpc

frequenz.api.microgrid.microgrid_pb2_grpc ¤

Client and server classes corresponding to protobuf-defined services.

Classes¤

frequenz.api.microgrid.microgrid_pb2_grpc.Microgrid ¤

Bases: object

Missing associated documentation comment in .proto file.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
class Microgrid(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def GetMicrogridMetadata(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListComponents(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/ListComponents',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListConnections(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/ListConnections',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StreamComponentData(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(request, target, '/frequenz.api.microgrid.Microgrid/StreamComponentData',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CanStreamData(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/CanStreamData',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddExclusionBounds(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/AddExclusionBounds',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddInclusionBounds(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/AddInclusionBounds',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetPowerActive(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/SetPowerActive',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetPowerReactive(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/SetPowerReactive',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Start(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/Start',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def HotStandby(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/HotStandby',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ColdStandby(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/ColdStandby',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Stop(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/Stop',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ErrorAck(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/ErrorAck',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

frequenz.api.microgrid.microgrid_pb2_grpc.MicrogridAsyncStub ¤

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ColdStandby(self, request, context):
        """Sets the given component into a cold-standby state, from which it can
        return into an operational state within at most 2 minutes.

        Performs the following sequence actions for the following component
        categories:

        * Inverter: Checks if AC and DC relays are closed, then
        * sets power to 0, and
        * opens AC relays

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call efffectively skips that action.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Stop(self, request, context):
        """Stops the component completely, potentially disengaging its power
        electronics controller(s).

        Performs the following sequence actions for the following component
        categories:

        * Inverter:
        * Brings component to the cold-standby state
        * opens DC relays

        * Battery: Checks if the power output is 0, then
        * opens DC relays

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.

        If a feature required to perform an action is missing, then that action is
        skipped.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ErrorAck(self, request, context):
        """Acknowledges any recoverable error reported by the component, and brings it
        back to the stopped or cold-standby state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_MicrogridServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetMicrogridMetadata': grpc.unary_unary_rpc_method_handler(
                    servicer.GetMicrogridMetadata,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.SerializeToString,
            ),
            'ListComponents': grpc.unary_unary_rpc_method_handler(
                    servicer.ListComponents,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.FromString,
                    response_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.SerializeToString,
            ),
            'ListConnections': grpc.unary_unary_rpc_method_handler(
                    servicer.ListConnections,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.FromString,
                    response_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.SerializeToString,
            ),
            'StreamComponentData': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamComponentData,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.SerializeToString,
            ),
            'CanStreamData': grpc.unary_unary_rpc_method_handler(
                    servicer.CanStreamData,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.SerializeToString,
            ),
            'AddExclusionBounds': grpc.unary_unary_rpc_method_handler(
                    servicer.AddExclusionBounds,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.FromString,
                    response_serializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.SerializeToString,
            ),
            'AddInclusionBounds': grpc.unary_unary_rpc_method_handler(
                    servicer.AddInclusionBounds,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.FromString,
                    response_serializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.SerializeToString,
            ),
            'SetPowerActive': grpc.unary_unary_rpc_method_handler(
                    servicer.SetPowerActive,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'SetPowerReactive': grpc.unary_unary_rpc_method_handler(
                    servicer.SetPowerReactive,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Start': grpc.unary_unary_rpc_method_handler(
                    servicer.Start,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'HotStandby': grpc.unary_unary_rpc_method_handler(
                    servicer.HotStandby,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'ColdStandby': grpc.unary_unary_rpc_method_handler(
                    servicer.ColdStandby,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'Stop': grpc.unary_unary_rpc_method_handler(
                    servicer.Stop,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'ErrorAck': grpc.unary_unary_rpc_method_handler(
                    servicer.ErrorAck,
                    request_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'frequenz.api.microgrid.Microgrid', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Microgrid(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def GetMicrogridMetadata(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListComponents(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/ListComponents',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListConnections(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/ListConnections',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StreamComponentData(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(request, target, '/frequenz.api.microgrid.Microgrid/StreamComponentData',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CanStreamData(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/CanStreamData',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddExclusionBounds(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/AddExclusionBounds',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddInclusionBounds(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/AddInclusionBounds',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetPowerActive(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/frequenz.api.microgrid.Microgrid/SetPowerActive',
            frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetPowerReactive(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
Attributes¤
AddExclusionBounds: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetBoundsParam, google.protobuf.timestamp_pb2.Timestamp] instance-attribute ¤

Adds exclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given exclusion bounds will stay in effect.

Exclusion bounds refer to the range of values that are disallowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraints value <= lower OR upper <= value.

Exclusion bounds are a useful tool for enhancing the performance of a system. They can be used to restrict the acceptance of commands that fall below a certain threshold, which can help ensure the smooth functioning of the system. E.g., exclusion bounds can be set to limit the minimum charging power to a sufficiently high level, preventing a peak-shaver client from sending charge powers that are too low when a DC heater client is executing a charge pulse. This can significantly improve the overall performance of the DC heating mechanism.

If multiple exclusion bounds have been provided bor a metric, then the aggregated lower and upper exclusion bounds are calculated as follows: lower: the minimum of all lower exclusion bounds upper: the maximum of all upper exclusion bounds

It is important to note that these bounds work together with system_inclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

  inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
               exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

AddInclusionBounds: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetBoundsParam, google.protobuf.timestamp_pb2.Timestamp] instance-attribute ¤

Adds inclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given inclusion bounds will stay in effect.

Inclusion bounds refer to the range of values that are allowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraint lower <= value <= upper.

If multiple inclusion bounds have been provided bor a metric, then the aggregated lower and upper inclusion bounds are calculated as follows: lower: the maximum of all lower inclusion bounds upper: the minimum of all upper inclusion bounds

It is important to note that these bounds work together with system_exclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

  inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
               exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

CanStreamData: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.wrappers_pb2.BoolValue] instance-attribute ¤

Returns whether the component with given ID can stream data.

ColdStandby: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Sets the given component into a cold-standby state, from which it can return into an operational state within at most 2 minutes.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0, and
  • opens AC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call efffectively skips that action.

ErrorAck: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Acknowledges any recoverable error reported by the component, and brings it back to the stopped or cold-standby state.

GetMicrogridMetadata: grpc.aio.UnaryUnaryMultiCallable[google.protobuf.empty_pb2.Empty, frequenz.api.microgrid.microgrid_pb2.MicrogridMetadata] instance-attribute ¤

/ Returns the microgrid metadata / The metadata consists of information that describes the overall / microgrid, as opposed to its components, / e.g., the microgrid ID, location.

HotStandby: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Sets the given component into a hot-standby state, from which it can return into an operational state within at most 5 seconds.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

ListComponents: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentFilter, frequenz.api.microgrid.microgrid_pb2.ComponentList] instance-attribute ¤

List components in the local microgrid, optionally filtered by a given list of component IDs and component categories.

If provided, the filters for component IDs and categories have an AND relationship with one another, meaning that they are applied serially, but the elements within a single filter list have an OR relationship with each other. E.g., if ids = [1, 2, 3], and categories = [ ComponentCategory::COMPONENT_CATEGORY_INVERTER, ComponentCategory::COMPONENT_CATEGORY_BATTERY], then the results will consist of elements that have the IDs 1, OR 2, OR 3, AND are of the categories ComponentCategory::COMPONENT_CATEGORY_INVERTER OR ComponentCategory::COMPONENT_CATEGORY_BATTERY.

If a filter list is empty, then that filter is not applied.

ListConnections: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ConnectionFilter, frequenz.api.microgrid.microgrid_pb2.ConnectionList] instance-attribute ¤

Returns a list of the connections between components as (start, end) pairs of connection IDs, where the direction of individual connections is always away from the grid endpoint, i.e. aligned with the direction of positive current according to the passive sign convention: https://en.wikipedia.org/wiki/Passive_sign_convention

The request may be filtered by start/end component(s) of individual connections. If provided, the start and end filters have an AND relationship between each other, meaning that they are applied serially, but an OR relationship with other elements in the same list. For example, if start = [1, 2, 3], and end = [4, 5, 6], then the result should have all the connections where * each start component ID is either 1, 2, OR 3, AND * each end component ID is either 4, 5, OR 6.

SetPowerActive: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetPowerActiveParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Sets the active power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 W. E.g., an inverter may have a resolution of 88 W. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Performs the following sequence actions for the following component categories:

  • Inverter: Sends the discharge command to the inverter, making it deliver AC power.
SetPowerReactive: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetPowerReactiveParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Sets the reactive power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 VAr. E.g., an inverter may have a resolution of 88 VAr. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Start: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Starts the component, and brings it into a state where it is immediately operational.

Performs the following sequence of actions for the following component categories:

  • Inverter:
  • closes DC relays, if the feature is available
  • closes AC relays
  • sets power output to 0

  • Battery: Checks if DC relays are open, then

  • closes DC relays

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

Stop: grpc.aio.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] instance-attribute ¤

Stops the component completely, potentially disengaging its power electronics controller(s).

Performs the following sequence actions for the following component categories:

  • Inverter:
  • Brings component to the cold-standby state
  • opens DC relays

  • Battery: Checks if the power output is 0, then

  • opens DC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

StreamComponentData: grpc.aio.UnaryStreamMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, frequenz.api.microgrid.microgrid_pb2.ComponentData] instance-attribute ¤

Returns a stream containing data from a component with a given ID.

frequenz.api.microgrid.microgrid_pb2_grpc.MicrogridServicer ¤

Bases: object

Missing associated documentation comment in .proto file.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
class MicrogridServicer(object):
    """Missing associated documentation comment in .proto file."""

    def GetMicrogridMetadata(self, request, context):
        """/ Returns the microgrid metadata
        / The metadata consists of information that describes the overall
        / microgrid, as opposed to its components,
        / e.g., the microgrid ID, location.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListComponents(self, request, context):
        """List components in the local microgrid, optionally filtered by a given list
        of component IDs and component categories.

        If provided, the filters for component IDs and categories have an `AND`
        relationship with one another, meaning that they are applied serially,
        but the elements within a single filter list have an `OR` relationship with
        each other.
        E.g., if `ids` = [1, 2, 3], and `categories` = [
        `ComponentCategory::COMPONENT_CATEGORY_INVERTER`,
        `ComponentCategory::COMPONENT_CATEGORY_BATTERY`],
        then the results will consist of elements that
        have the IDs 1, OR 2, OR 3,
        AND
        are of the categories `ComponentCategory::COMPONENT_CATEGORY_INVERTER` OR
        `ComponentCategory::COMPONENT_CATEGORY_BATTERY`.

        If a filter list is empty, then that filter is not applied.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListConnections(self, request, context):
        """Returns a list of the connections between components as `(start, end)`
        pairs of connection IDs, where the direction of individual connections
        is always away from the grid endpoint, i.e. aligned with the direction
        of positive current according to the passive sign convention:
        https://en.wikipedia.org/wiki/Passive_sign_convention

        The request may be filtered by `start`/`end` component(s) of individual
        connections.  If provided, the `start` and `end` filters have an `AND`
        relationship between each other, meaning that they are applied serially,
        but an `OR` relationship with other elements in the same list.
        For example, if `start` = `[1, 2, 3]`, and `end` = `[4, 5, 6]`, then the
        result should have all the connections where
        * each `start` component ID is either `1`, `2`, OR `3`,
        AND
        * each `end` component ID is either `4`, `5`, OR `6`.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamComponentData(self, request, context):
        """Returns a stream containing data from a component with a given ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CanStreamData(self, request, context):
        """Returns whether the component with given ID can stream data.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddExclusionBounds(self, request, context):
        """Adds exclusion bounds for a given metric of a given component, and returns
        the UTC timestamp until which the given exclusion bounds will stay in
        effect.

        Exclusion bounds refer to the range of values that are disallowed for the
        metric. If these bounds for a metric are [`lower`, `upper`], then this
        metric's `value` needs to comply with the constraints
        `value <= lower` OR `upper <= value`.

        Exclusion bounds are a useful tool for enhancing the performance of a
        system. They can be used to restrict the acceptance of commands that fall
        below a certain threshold, which can help ensure the smooth functioning of
        the system.
        E.g., exclusion bounds can be set to limit the minimum charging power to a
        sufficiently high level, preventing a peak-shaver client from sending
        charge powers that are too low when a DC heater client is executing a
        charge pulse. This can significantly improve the overall performance of the
        DC heating mechanism.


        If multiple exclusion bounds have been provided bor a metric, then the
        aggregated lower and upper exclusion bounds are calculated as follows:
        lower: the minimum of all lower exclusion bounds
        upper: the maximum of all upper exclusion bounds

        It is important to note that these bounds work together with
        `system_inclusion_bounds`.

        E.g., for the system to accept a charge command,
        clients need to request power values within the bounds
        `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
        This means that clients can only request charge commands with values that
        are within the `system_inclusion_bounds`, but not within
        `system_exclusion_bounds`.
        Similarly, for the system to accept a discharge command,
        clients need to request power values within the bounds
        `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.

        The following diagram illustrates the relationship between the bounds.
        ```
        inclusion.lower                              inclusion.upper
        <-------|============|------------------|============|--------->
        exclusion.lower    exclusion.upper
        ```
        ---- values here are disallowed and wil be rejected
        ==== vales here are allowed and will be accepted
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddInclusionBounds(self, request, context):
        """Adds inclusion bounds for a given metric of a given component, and returns
        the UTC timestamp until which the given inclusion bounds will stay in
        effect.

        Inclusion bounds refer to the range of values that are allowed for the
        metric. If these bounds for a metric are [`lower`, `upper`], then this
        metric's `value` needs to comply with the constraint
        `lower <= value <= upper`.

        If multiple inclusion bounds have been provided bor a metric, then the
        aggregated lower and upper inclusion bounds are calculated as follows:
        lower: the maximum of all lower inclusion bounds
        upper: the minimum of all upper inclusion bounds

        It is important to note that these bounds work together with
        `system_exclusion_bounds`.

        E.g., for the system to accept a charge command,
        clients need to request power values within the bounds
        `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
        This means that clients can only request charge commands with values that
        are within the `system_inclusion_bounds`, but not within
        `system_exclusion_bounds`.
        Similarly, for the system to accept a discharge command,
        clients need to request power values within the bounds
        `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.

        The following diagram illustrates the relationship between the bounds.
        ```
        inclusion.lower                              inclusion.upper
        <-------|============|------------------|============|--------->
        exclusion.lower    exclusion.upper
        ```
        ---- values here are disallowed and wil be rejected
        ==== vales here are allowed and will be accepted
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetPowerActive(self, request, context):
        """Sets the active power output of a component with a given ID, provided the
        component supports it.

        Note that the target component may have a resolution of more than 1 W.
        E.g., an inverter may have a resolution of 88 W.
        In such cases, the magnitude of power will be floored to the nearest
        multiple of the resolution.

        Performs the following sequence actions for the following component
        categories:

        * Inverter: Sends the discharge command to the inverter, making it deliver
        AC power.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetPowerReactive(self, request, context):
        """Sets the reactive power output of a component with a given ID, provided the
        component supports it.

        Note that the target component may have a resolution of more than 1 VAr.
        E.g., an inverter may have a resolution of 88 VAr.
        In such cases, the magnitude of power will be floored to the nearest
        multiple of the resolution.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Start(self, request, context):
        """Starts the component, and brings it into a state where it is immediately
        operational.

        Performs the following sequence of actions for the following component
        categories:

        * Inverter:
        * closes DC relays, if the feature is available
        * closes AC relays
        * sets power output to 0

        * Battery: Checks if DC relays are open, then
        * closes DC relays

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.

        If a feature required to perform an action is missing, then that action is
        skipped.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def HotStandby(self, request, context):
        """Sets the given component into a hot-standby state, from which it can return
        into an operational state within at most 5 seconds.

        Performs the following sequence actions for the following component
        categories:

        * Inverter: Checks if AC and DC relays are closed, then
        * sets power to 0

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ColdStandby(self, request, context):
        """Sets the given component into a cold-standby state, from which it can
        return into an operational state within at most 2 minutes.

        Performs the following sequence actions for the following component
        categories:

        * Inverter: Checks if AC and DC relays are closed, then
        * sets power to 0, and
        * opens AC relays

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call efffectively skips that action.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Stop(self, request, context):
        """Stops the component completely, potentially disengaging its power
        electronics controller(s).

        Performs the following sequence actions for the following component
        categories:

        * Inverter:
        * Brings component to the cold-standby state
        * opens DC relays

        * Battery: Checks if the power output is 0, then
        * opens DC relays

        If any of the checks mentioned above fails, then the method call returns an
        error.

        If any of the above mentioned actions for a given component has already
        been performed, then this method call effectively skips that action.

        If a feature required to perform an action is missing, then that action is
        skipped.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ErrorAck(self, request, context):
        """Acknowledges any recoverable error reported by the component, and brings it
        back to the stopped or cold-standby state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')
Functions¤
AddExclusionBounds(request, context) ¤

Adds exclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given exclusion bounds will stay in effect.

Exclusion bounds refer to the range of values that are disallowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraints value <= lower OR upper <= value.

Exclusion bounds are a useful tool for enhancing the performance of a system. They can be used to restrict the acceptance of commands that fall below a certain threshold, which can help ensure the smooth functioning of the system. E.g., exclusion bounds can be set to limit the minimum charging power to a sufficiently high level, preventing a peak-shaver client from sending charge powers that are too low when a DC heater client is executing a charge pulse. This can significantly improve the overall performance of the DC heating mechanism.

If multiple exclusion bounds have been provided bor a metric, then the aggregated lower and upper exclusion bounds are calculated as follows: lower: the minimum of all lower exclusion bounds upper: the maximum of all upper exclusion bounds

It is important to note that these bounds work together with system_inclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def AddExclusionBounds(self, request, context):
    """Adds exclusion bounds for a given metric of a given component, and returns
    the UTC timestamp until which the given exclusion bounds will stay in
    effect.

    Exclusion bounds refer to the range of values that are disallowed for the
    metric. If these bounds for a metric are [`lower`, `upper`], then this
    metric's `value` needs to comply with the constraints
    `value <= lower` OR `upper <= value`.

    Exclusion bounds are a useful tool for enhancing the performance of a
    system. They can be used to restrict the acceptance of commands that fall
    below a certain threshold, which can help ensure the smooth functioning of
    the system.
    E.g., exclusion bounds can be set to limit the minimum charging power to a
    sufficiently high level, preventing a peak-shaver client from sending
    charge powers that are too low when a DC heater client is executing a
    charge pulse. This can significantly improve the overall performance of the
    DC heating mechanism.


    If multiple exclusion bounds have been provided bor a metric, then the
    aggregated lower and upper exclusion bounds are calculated as follows:
    lower: the minimum of all lower exclusion bounds
    upper: the maximum of all upper exclusion bounds

    It is important to note that these bounds work together with
    `system_inclusion_bounds`.

    E.g., for the system to accept a charge command,
    clients need to request power values within the bounds
    `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
    This means that clients can only request charge commands with values that
    are within the `system_inclusion_bounds`, but not within
    `system_exclusion_bounds`.
    Similarly, for the system to accept a discharge command,
    clients need to request power values within the bounds
    `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.

    The following diagram illustrates the relationship between the bounds.
    ```
    inclusion.lower                              inclusion.upper
    <-------|============|------------------|============|--------->
    exclusion.lower    exclusion.upper
    ```
    ---- values here are disallowed and wil be rejected
    ==== vales here are allowed and will be accepted
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
AddInclusionBounds(request, context) ¤

Adds inclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given inclusion bounds will stay in effect.

Inclusion bounds refer to the range of values that are allowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraint lower <= value <= upper.

If multiple inclusion bounds have been provided bor a metric, then the aggregated lower and upper inclusion bounds are calculated as follows: lower: the maximum of all lower inclusion bounds upper: the minimum of all upper inclusion bounds

It is important to note that these bounds work together with system_exclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def AddInclusionBounds(self, request, context):
    """Adds inclusion bounds for a given metric of a given component, and returns
    the UTC timestamp until which the given inclusion bounds will stay in
    effect.

    Inclusion bounds refer to the range of values that are allowed for the
    metric. If these bounds for a metric are [`lower`, `upper`], then this
    metric's `value` needs to comply with the constraint
    `lower <= value <= upper`.

    If multiple inclusion bounds have been provided bor a metric, then the
    aggregated lower and upper inclusion bounds are calculated as follows:
    lower: the maximum of all lower inclusion bounds
    upper: the minimum of all upper inclusion bounds

    It is important to note that these bounds work together with
    `system_exclusion_bounds`.

    E.g., for the system to accept a charge command,
    clients need to request power values within the bounds
    `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
    This means that clients can only request charge commands with values that
    are within the `system_inclusion_bounds`, but not within
    `system_exclusion_bounds`.
    Similarly, for the system to accept a discharge command,
    clients need to request power values within the bounds
    `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.

    The following diagram illustrates the relationship between the bounds.
    ```
    inclusion.lower                              inclusion.upper
    <-------|============|------------------|============|--------->
    exclusion.lower    exclusion.upper
    ```
    ---- values here are disallowed and wil be rejected
    ==== vales here are allowed and will be accepted
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
CanStreamData(request, context) ¤

Returns whether the component with given ID can stream data.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def CanStreamData(self, request, context):
    """Returns whether the component with given ID can stream data.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
ColdStandby(request, context) ¤

Sets the given component into a cold-standby state, from which it can return into an operational state within at most 2 minutes.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0, and
  • opens AC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call efffectively skips that action.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def ColdStandby(self, request, context):
    """Sets the given component into a cold-standby state, from which it can
    return into an operational state within at most 2 minutes.

    Performs the following sequence actions for the following component
    categories:

    * Inverter: Checks if AC and DC relays are closed, then
    * sets power to 0, and
    * opens AC relays

    If any of the checks mentioned above fails, then the method call returns an
    error.

    If any of the above mentioned actions for a given component has already
    been performed, then this method call efffectively skips that action.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
ErrorAck(request, context) ¤

Acknowledges any recoverable error reported by the component, and brings it back to the stopped or cold-standby state.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def ErrorAck(self, request, context):
    """Acknowledges any recoverable error reported by the component, and brings it
    back to the stopped or cold-standby state.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
GetMicrogridMetadata(request, context) ¤

/ Returns the microgrid metadata / The metadata consists of information that describes the overall / microgrid, as opposed to its components, / e.g., the microgrid ID, location.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def GetMicrogridMetadata(self, request, context):
    """/ Returns the microgrid metadata
    / The metadata consists of information that describes the overall
    / microgrid, as opposed to its components,
    / e.g., the microgrid ID, location.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
HotStandby(request, context) ¤

Sets the given component into a hot-standby state, from which it can return into an operational state within at most 5 seconds.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def HotStandby(self, request, context):
    """Sets the given component into a hot-standby state, from which it can return
    into an operational state within at most 5 seconds.

    Performs the following sequence actions for the following component
    categories:

    * Inverter: Checks if AC and DC relays are closed, then
    * sets power to 0

    If any of the checks mentioned above fails, then the method call returns an
    error.

    If any of the above mentioned actions for a given component has already
    been performed, then this method call effectively skips that action.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
ListComponents(request, context) ¤

List components in the local microgrid, optionally filtered by a given list of component IDs and component categories.

If provided, the filters for component IDs and categories have an AND relationship with one another, meaning that they are applied serially, but the elements within a single filter list have an OR relationship with each other. E.g., if ids = [1, 2, 3], and categories = [ ComponentCategory::COMPONENT_CATEGORY_INVERTER, ComponentCategory::COMPONENT_CATEGORY_BATTERY], then the results will consist of elements that have the IDs 1, OR 2, OR 3, AND are of the categories ComponentCategory::COMPONENT_CATEGORY_INVERTER OR ComponentCategory::COMPONENT_CATEGORY_BATTERY.

If a filter list is empty, then that filter is not applied.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def ListComponents(self, request, context):
    """List components in the local microgrid, optionally filtered by a given list
    of component IDs and component categories.

    If provided, the filters for component IDs and categories have an `AND`
    relationship with one another, meaning that they are applied serially,
    but the elements within a single filter list have an `OR` relationship with
    each other.
    E.g., if `ids` = [1, 2, 3], and `categories` = [
    `ComponentCategory::COMPONENT_CATEGORY_INVERTER`,
    `ComponentCategory::COMPONENT_CATEGORY_BATTERY`],
    then the results will consist of elements that
    have the IDs 1, OR 2, OR 3,
    AND
    are of the categories `ComponentCategory::COMPONENT_CATEGORY_INVERTER` OR
    `ComponentCategory::COMPONENT_CATEGORY_BATTERY`.

    If a filter list is empty, then that filter is not applied.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
ListConnections(request, context) ¤

Returns a list of the connections between components as (start, end) pairs of connection IDs, where the direction of individual connections is always away from the grid endpoint, i.e. aligned with the direction of positive current according to the passive sign convention: https://en.wikipedia.org/wiki/Passive_sign_convention

The request may be filtered by start/end component(s) of individual connections. If provided, the start and end filters have an AND relationship between each other, meaning that they are applied serially, but an OR relationship with other elements in the same list. For example, if start = [1, 2, 3], and end = [4, 5, 6], then the result should have all the connections where * each start component ID is either 1, 2, OR 3, AND * each end component ID is either 4, 5, OR 6.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def ListConnections(self, request, context):
    """Returns a list of the connections between components as `(start, end)`
    pairs of connection IDs, where the direction of individual connections
    is always away from the grid endpoint, i.e. aligned with the direction
    of positive current according to the passive sign convention:
    https://en.wikipedia.org/wiki/Passive_sign_convention

    The request may be filtered by `start`/`end` component(s) of individual
    connections.  If provided, the `start` and `end` filters have an `AND`
    relationship between each other, meaning that they are applied serially,
    but an `OR` relationship with other elements in the same list.
    For example, if `start` = `[1, 2, 3]`, and `end` = `[4, 5, 6]`, then the
    result should have all the connections where
    * each `start` component ID is either `1`, `2`, OR `3`,
    AND
    * each `end` component ID is either `4`, `5`, OR `6`.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
SetPowerActive(request, context) ¤

Sets the active power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 W. E.g., an inverter may have a resolution of 88 W. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Performs the following sequence actions for the following component categories:

  • Inverter: Sends the discharge command to the inverter, making it deliver AC power.
Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def SetPowerActive(self, request, context):
    """Sets the active power output of a component with a given ID, provided the
    component supports it.

    Note that the target component may have a resolution of more than 1 W.
    E.g., an inverter may have a resolution of 88 W.
    In such cases, the magnitude of power will be floored to the nearest
    multiple of the resolution.

    Performs the following sequence actions for the following component
    categories:

    * Inverter: Sends the discharge command to the inverter, making it deliver
    AC power.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
SetPowerReactive(request, context) ¤

Sets the reactive power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 VAr. E.g., an inverter may have a resolution of 88 VAr. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def SetPowerReactive(self, request, context):
    """Sets the reactive power output of a component with a given ID, provided the
    component supports it.

    Note that the target component may have a resolution of more than 1 VAr.
    E.g., an inverter may have a resolution of 88 VAr.
    In such cases, the magnitude of power will be floored to the nearest
    multiple of the resolution.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
Start(request, context) ¤

Starts the component, and brings it into a state where it is immediately operational.

Performs the following sequence of actions for the following component categories:

  • Inverter:
  • closes DC relays, if the feature is available
  • closes AC relays
  • sets power output to 0

  • Battery: Checks if DC relays are open, then

  • closes DC relays

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def Start(self, request, context):
    """Starts the component, and brings it into a state where it is immediately
    operational.

    Performs the following sequence of actions for the following component
    categories:

    * Inverter:
    * closes DC relays, if the feature is available
    * closes AC relays
    * sets power output to 0

    * Battery: Checks if DC relays are open, then
    * closes DC relays

    If any of the above mentioned actions for a given component has already
    been performed, then this method call effectively skips that action.

    If a feature required to perform an action is missing, then that action is
    skipped.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
Stop(request, context) ¤

Stops the component completely, potentially disengaging its power electronics controller(s).

Performs the following sequence actions for the following component categories:

  • Inverter:
  • Brings component to the cold-standby state
  • opens DC relays

  • Battery: Checks if the power output is 0, then

  • opens DC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def Stop(self, request, context):
    """Stops the component completely, potentially disengaging its power
    electronics controller(s).

    Performs the following sequence actions for the following component
    categories:

    * Inverter:
    * Brings component to the cold-standby state
    * opens DC relays

    * Battery: Checks if the power output is 0, then
    * opens DC relays

    If any of the checks mentioned above fails, then the method call returns an
    error.

    If any of the above mentioned actions for a given component has already
    been performed, then this method call effectively skips that action.

    If a feature required to perform an action is missing, then that action is
    skipped.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')
StreamComponentData(request, context) ¤

Returns a stream containing data from a component with a given ID.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def StreamComponentData(self, request, context):
    """Returns a stream containing data from a component with a given ID.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

frequenz.api.microgrid.microgrid_pb2_grpc.MicrogridStub ¤

Bases: object

Missing associated documentation comment in .proto file.

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
class MicrogridStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.GetMicrogridMetadata = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString,
                )
        self.ListComponents = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/ListComponents',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString,
                response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString,
                )
        self.ListConnections = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/ListConnections',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString,
                response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString,
                )
        self.StreamComponentData = channel.unary_stream(
                '/frequenz.api.microgrid.Microgrid/StreamComponentData',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString,
                )
        self.CanStreamData = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/CanStreamData',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString,
                )
        self.AddExclusionBounds = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/AddExclusionBounds',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
                )
        self.AddInclusionBounds = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/AddInclusionBounds',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
                )
        self.SetPowerActive = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/SetPowerActive',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.SetPowerReactive = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/SetPowerReactive',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.Start = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/Start',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.HotStandby = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/HotStandby',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.ColdStandby = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/ColdStandby',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.Stop = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/Stop',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.ErrorAck = channel.unary_unary(
                '/frequenz.api.microgrid.Microgrid/ErrorAck',
                request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
Attributes¤
AddExclusionBounds: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetBoundsParam, google.protobuf.timestamp_pb2.Timestamp] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/AddExclusionBounds', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString) instance-attribute ¤

Adds exclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given exclusion bounds will stay in effect.

Exclusion bounds refer to the range of values that are disallowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraints value <= lower OR upper <= value.

Exclusion bounds are a useful tool for enhancing the performance of a system. They can be used to restrict the acceptance of commands that fall below a certain threshold, which can help ensure the smooth functioning of the system. E.g., exclusion bounds can be set to limit the minimum charging power to a sufficiently high level, preventing a peak-shaver client from sending charge powers that are too low when a DC heater client is executing a charge pulse. This can significantly improve the overall performance of the DC heating mechanism.

If multiple exclusion bounds have been provided bor a metric, then the aggregated lower and upper exclusion bounds are calculated as follows: lower: the minimum of all lower exclusion bounds upper: the maximum of all upper exclusion bounds

It is important to note that these bounds work together with system_inclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

  inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
               exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

AddInclusionBounds: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetBoundsParam, google.protobuf.timestamp_pb2.Timestamp] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/AddInclusionBounds', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString) instance-attribute ¤

Adds inclusion bounds for a given metric of a given component, and returns the UTC timestamp until which the given inclusion bounds will stay in effect.

Inclusion bounds refer to the range of values that are allowed for the metric. If these bounds for a metric are [lower, upper], then this metric's value needs to comply with the constraint lower <= value <= upper.

If multiple inclusion bounds have been provided bor a metric, then the aggregated lower and upper inclusion bounds are calculated as follows: lower: the maximum of all lower inclusion bounds upper: the minimum of all upper inclusion bounds

It is important to note that these bounds work together with system_exclusion_bounds.

E.g., for the system to accept a charge command, clients need to request power values within the bounds [system_inclusion_bounds.lower, system_exclusion_bounds.lower]. This means that clients can only request charge commands with values that are within the system_inclusion_bounds, but not within system_exclusion_bounds. Similarly, for the system to accept a discharge command, clients need to request power values within the bounds [system_exclusion_bounds.upper, system_inclusion_bounds.upper].

The following diagram illustrates the relationship between the bounds.

  inclusion.lower                              inclusion.upper
<-------|============|------------------|============|--------->
               exclusion.lower    exclusion.upper
---- values here are disallowed and wil be rejected ==== vales here are allowed and will be accepted

CanStreamData: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.wrappers_pb2.BoolValue] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/CanStreamData', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString) instance-attribute ¤

Returns whether the component with given ID can stream data.

ColdStandby: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/ColdStandby', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString) instance-attribute ¤

Sets the given component into a cold-standby state, from which it can return into an operational state within at most 2 minutes.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0, and
  • opens AC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call efffectively skips that action.

ErrorAck: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/ErrorAck', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString) instance-attribute ¤

Acknowledges any recoverable error reported by the component, and brings it back to the stopped or cold-standby state.

GetMicrogridMetadata: grpc.UnaryUnaryMultiCallable[google.protobuf.empty_pb2.Empty, frequenz.api.microgrid.microgrid_pb2.MicrogridMetadata] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString) instance-attribute ¤

/ Returns the microgrid metadata / The metadata consists of information that describes the overall / microgrid, as opposed to its components, / e.g., the microgrid ID, location.

HotStandby: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/HotStandby', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString) instance-attribute ¤

Sets the given component into a hot-standby state, from which it can return into an operational state within at most 5 seconds.

Performs the following sequence actions for the following component categories:

  • Inverter: Checks if AC and DC relays are closed, then
  • sets power to 0

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

ListComponents: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentFilter, frequenz.api.microgrid.microgrid_pb2.ComponentList] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/ListComponents', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString, response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString) instance-attribute ¤

List components in the local microgrid, optionally filtered by a given list of component IDs and component categories.

If provided, the filters for component IDs and categories have an AND relationship with one another, meaning that they are applied serially, but the elements within a single filter list have an OR relationship with each other. E.g., if ids = [1, 2, 3], and categories = [ ComponentCategory::COMPONENT_CATEGORY_INVERTER, ComponentCategory::COMPONENT_CATEGORY_BATTERY], then the results will consist of elements that have the IDs 1, OR 2, OR 3, AND are of the categories ComponentCategory::COMPONENT_CATEGORY_INVERTER OR ComponentCategory::COMPONENT_CATEGORY_BATTERY.

If a filter list is empty, then that filter is not applied.

ListConnections: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ConnectionFilter, frequenz.api.microgrid.microgrid_pb2.ConnectionList] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/ListConnections', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString, response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString) instance-attribute ¤

Returns a list of the connections between components as (start, end) pairs of connection IDs, where the direction of individual connections is always away from the grid endpoint, i.e. aligned with the direction of positive current according to the passive sign convention: https://en.wikipedia.org/wiki/Passive_sign_convention

The request may be filtered by start/end component(s) of individual connections. If provided, the start and end filters have an AND relationship between each other, meaning that they are applied serially, but an OR relationship with other elements in the same list. For example, if start = [1, 2, 3], and end = [4, 5, 6], then the result should have all the connections where * each start component ID is either 1, 2, OR 3, AND * each end component ID is either 4, 5, OR 6.

SetPowerActive: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetPowerActiveParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/SetPowerActive', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString) instance-attribute ¤

Sets the active power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 W. E.g., an inverter may have a resolution of 88 W. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Performs the following sequence actions for the following component categories:

  • Inverter: Sends the discharge command to the inverter, making it deliver AC power.
SetPowerReactive: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.SetPowerReactiveParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/SetPowerReactive', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString) instance-attribute ¤

Sets the reactive power output of a component with a given ID, provided the component supports it.

Note that the target component may have a resolution of more than 1 VAr. E.g., an inverter may have a resolution of 88 VAr. In such cases, the magnitude of power will be floored to the nearest multiple of the resolution.

Start: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/Start', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString) instance-attribute ¤

Starts the component, and brings it into a state where it is immediately operational.

Performs the following sequence of actions for the following component categories:

  • Inverter:
  • closes DC relays, if the feature is available
  • closes AC relays
  • sets power output to 0

  • Battery: Checks if DC relays are open, then

  • closes DC relays

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

Stop: grpc.UnaryUnaryMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, google.protobuf.empty_pb2.Empty] = channel.unary_unary('/frequenz.api.microgrid.Microgrid/Stop', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString) instance-attribute ¤

Stops the component completely, potentially disengaging its power electronics controller(s).

Performs the following sequence actions for the following component categories:

  • Inverter:
  • Brings component to the cold-standby state
  • opens DC relays

  • Battery: Checks if the power output is 0, then

  • opens DC relays

If any of the checks mentioned above fails, then the method call returns an error.

If any of the above mentioned actions for a given component has already been performed, then this method call effectively skips that action.

If a feature required to perform an action is missing, then that action is skipped.

StreamComponentData: grpc.UnaryStreamMultiCallable[frequenz.api.microgrid.microgrid_pb2.ComponentIdParam, frequenz.api.microgrid.microgrid_pb2.ComponentData] = channel.unary_stream('/frequenz.api.microgrid.Microgrid/StreamComponentData', request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString, response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString) instance-attribute ¤

Returns a stream containing data from a component with a given ID.

Functions¤
__init__(channel) ¤

Constructor.

PARAMETER DESCRIPTION
channel

A grpc.Channel.

TYPE: Union[Channel, Channel]

Source code in frequenz/api/microgrid/microgrid_pb2_grpc.py
def __init__(self, channel):
    """Constructor.

    Args:
        channel: A grpc.Channel.
    """
    self.GetMicrogridMetadata = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/GetMicrogridMetadata',
            request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.MicrogridMetadata.FromString,
            )
    self.ListComponents = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/ListComponents',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentFilter.SerializeToString,
            response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentList.FromString,
            )
    self.ListConnections = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/ListConnections',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionFilter.SerializeToString,
            response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ConnectionList.FromString,
            )
    self.StreamComponentData = channel.unary_stream(
            '/frequenz.api.microgrid.Microgrid/StreamComponentData',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentData.FromString,
            )
    self.CanStreamData = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/CanStreamData',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_wrappers__pb2.BoolValue.FromString,
            )
    self.AddExclusionBounds = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/AddExclusionBounds',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            )
    self.AddInclusionBounds = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/AddInclusionBounds',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetBoundsParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_timestamp__pb2.Timestamp.FromString,
            )
    self.SetPowerActive = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/SetPowerActive',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerActiveParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            )
    self.SetPowerReactive = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/SetPowerReactive',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.SetPowerReactiveParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            )
    self.Start = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/Start',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            )
    self.HotStandby = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/HotStandby',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            )
    self.ColdStandby = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/ColdStandby',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            )
    self.Stop = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/Stop',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            )
    self.ErrorAck = channel.unary_unary(
            '/frequenz.api.microgrid.Microgrid/ErrorAck',
            request_serializer=frequenz_dot_api_dot_microgrid_dot_microgrid__pb2.ComponentIdParam.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            )